Skip to content

Instantly share code, notes, and snippets.

@desouradeep

desouradeep/client.js

Last active Aug 29, 2015
Embed
What would you like to do?
Client socket JavaScript
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
You can’t perform that action at this time.