Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const WebSocketServer = require('ws').Server;
- const WSS = new WebSocketServer({port: 3333});
- WSS.on('connection', (ws)=>{
- console.log('We are connected');
- ws.on("message", (message) => {
- WSS.clients.forEach((client)=>{
- client.send(message);
- });
- console.log(message);
- });
- });
Add Comment
Please, Sign In to add comment