From Toxic Crane, 4 Years ago, written in Java.
Embed
  1. var WebSocketServer = require('ws').Server
  2. , wss = new WebSocketServer({port: 8080});
  3. wss.on('connection', function(ws) {
  4. ws.on('message', function(message) {
  5. console.log('received: %s', message);
  6. });
  7.  
  8. ws.send('something');
  9. var x = 1;
  10. while (x < 10000)
  11. {
  12. ws.send("TEST!!!");
  13. x++;
  14. }
  15. });
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.