Skip to content

Instantly share code, notes, and snippets.

View defshift's full-sized avatar
📇
Some coding

Ivan Sotnikov defshift

📇
Some coding
  • Bratislava, Slovakia
View GitHub Profile
@defshift
defshift / client.js
Created December 24, 2013 10:38 — forked from crtr0/client.js
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});