mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-12-26 20:43:08 +00:00
9 lines
254 B
JavaScript
9 lines
254 B
JavaScript
const socket = new WebSocket('ws://localhost:3000/ws');
|
|
|
|
socket.addEventListener('open', function (event) {
|
|
socket.send('Hello Server!');
|
|
});
|
|
|
|
socket.addEventListener('message', function (event) {
|
|
console.log('Message from server ', event.data);
|
|
});
|