Skip to content

Instantly share code, notes, and snippets.

@notdol
Created January 29, 2013 06:21
Show Gist options
  • Save notdol/4662230 to your computer and use it in GitHub Desktop.
Save notdol/4662230 to your computer and use it in GitHub Desktop.
Socketio: create service (client)
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://localhost:9090');
socket.on('news', function (data) {
console.log(data);
socket.emit('my other event', { my: 'data' });
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment