You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

7 lines
231 B

8 years ago
  1. <script src="/socket.io/socket.io.js"></script>
  2. <script>
  3. var socket = io.connect('http://localhost');
  4. socket.on('news', function (data) {
  5. console.log(data);
  6. socket.emit('my other event', { my: 'data' });
  7. });
  8. </script>