Last active
August 29, 2015 14:11
-
-
Save desouradeep/cd767d4da1f96aa0e1c6 to your computer and use it in GitHub Desktop.
Client socket JavaScript
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
WEB_SOCKET_SWF_LOCATION = "/static/WebSocketMain.swf"; | |
WEB_SOCKET_DEBUG = true; | |
socket = io.connect('http://' + document.domain + ':' + location.port); | |
var client_message = "This is a client, I am attemping to communicate"; | |
socket.emit("channel-a", client_message); | |
console.log("[x] Sent : " + client_message); | |
socket.on('channel-a', function(message) { | |
console.log("[x] Received : " + message); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment