Created
January 29, 2013 06:21
-
-
Save notdol/4662230 to your computer and use it in GitHub Desktop.
Socketio: create service (client)
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
<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