Get started with iris-ws CDN
BSD-3-Clause licensed
Iris-WS is a lightweight library for building RESTful web services using Node.js and Express.
Tags:- iris
- golang
- websocket
- iris-golang
- rich-websocket-server
- cross-platform
Stable version
Copied!
How to start using iris-ws CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with iris-ws CDN - cdnhub.io</title>
<script src="https://cdn.cdnhub.io/iris-ws/12.2.10/client.min.js"></script>
</head>
<body>
<button id="connect">Connect</button>
<div id="messages"></div>
<script>
const socket = new Iris.Socket('wss://your-websocket-server.com');
const connectButton = document.getElementById('connect');
const messagesDiv = document.getElementById('messages');
connectButton.addEventListener('click', () => {
socket.connect();
socket.on('open', () => {
connectButton.textContent = 'Disconnect';
console.log('Connected to WebSocket server.');
socket.send('Hello, WebSocket!');
socket.on('message', (message) => {
const messageElement = document.createElement('p');
messageElement.textContent = message;
messagesDiv.appendChild(messageElement);
});
});
socket.on('close', () => {
connectButton.textContent = 'Connect';
console.log('Disconnected from WebSocket server.');
});
});
</script>
</body>
</html>
All versions
10.7.0
11.1.1
12.1.1
12.1.2
12.1.3
12.1.4
12.1.5
12.1.6
12.1.7
12.1.8
12.2.0
12.2.0-alpha
12.2.0-alpha2
12.2.0-alpha3
12.2.0-alpha4
12.2.0-alpha5
12.2.0-alpha6
12.2.0-alpha7
12.2.0-alpha8
12.2.0-alpha9
12.2.0-beta1
12.2.0-beta2
12.2.0-beta3
12.2.0-beta4
12.2.0-beta5
12.2.0-beta6
12.2.0-beta7
12.2.1
12.2.10
*** 12.2.11
12.2.4
12.2.5
12.2.7
12.2.8
12.2.9