Commit db2628ee authored by Sylvain Coulange's avatar Sylvain Coulange
Browse files

test websocket 2

parent 6d4909ed
// Create WebSocket connection.
const socket = new WebSocket('ws://127.0.0.1:8080');
// Connection opened
socket.addEventListener('open', function (event) {
socket.send('Hello Server!');
console.log('Connected to WS server.')
});
// Listen for messages
socket.addEventListener('message', function (event) {
console.log('Message from server ', event.data);
});
const sendMessage = () => {
socket.send('Hello from Client1 !');
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment