Skip to content

Instantly share code, notes, and snippets.

@hebbian
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hebbian/aa88da1930ba17786cf1 to your computer and use it in GitHub Desktop.
Save hebbian/aa88da1930ba17786cf1 to your computer and use it in GitHub Desktop.
io.on("connection", function(socket) {
console.log('A user connected');
socket.emit('message', { message: 'welcome to the chat' });
socket.on('send:message', function(data) {
console.log(data);
socket.emit('message', data);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment