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

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -