Have you tried setting the server source parameter (it sets the header you mentioned)?
var sio = require('socket.io'); var io = sio.listen(8077, {log: false, origins: '*:*'});
In addition, now that you have not accessed this server locally, you must have updated the line:
var socket = io.connect('http://localhost:8077');
enable ip (or domain, if you have one) of the remote server:
var socket = io.connect('http://XX.XX.XX.XX:8077');
You see which line returns an error in the console (are you using chrome / ff with firebug?). In an if statement, the socket variable will probably never be undefined. The recommended way to use a connection is to wait for it to be ready by adding a callback to the connect event, for example:
socket.on('connect', function () {
source share