Created
November 3, 2012 21:07
-
-
Save protestContest/4008814 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
console.log('connecting...'); | |
connect(); | |
}); | |
function connect() { | |
console.log('connecting to ' + window.location.host); | |
var socket = new io.connect('http://' + window.location.host); | |
// partner is connected | |
socket.on('ready', function() { | |
console.log('connection made'); | |
}); | |
// receive message | |
socket.on('message', function(msg) { | |
console.log('message: ' + msg); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment