node.js - How to use socket.io with a remote server? -
i trying implementing socket.io in tutorials follow says connect server.js local index.html file:
var server = http.createserver(function(req, res) { fs.readfile('./index.html', 'utf-8', function(error, content) { res.writehead(200, {"content-type": "text/html"}); res.end(content); });
});
since, site files on server, how can connect remote server has socket.io. , how instance server.js without loading index.html file?
(i want basics of web sockets: send , receive message)
Comments
Post a Comment