Connecting to a server created with node.js with


I had a working project that I came back to try add things, to find out that it is not working anymore.
I managed to narrow down the problem, and it seems to be that the client can not connect to the server created with
To try to figure out what is wrong, I forked the project in the tutorial , and changged the address the client should connect to by changing a line in network.js to
socket = io.connect(‘http://localhost:3000/’);
(The server.js file I’m using is the same as the one in the tutorial.)
It seems that if I put socket = io.connect(‘’); , the client connects to my server created by node js perfectly, but if I replace by localhost, it does not work anymore.
I also tried to add this line to my server.js file
var server = http.createServer(function (request, response) {
response.writeHead(200, {“Content-Type”: “text/plain”});
response.end(“Hello World\n”);
And I can connect to the page on my browser with both and http://localhost:3000.
So, I assumed that there is some problem with using localhose with but I can not figure out what is wrong.
Since the code was working perfectly 2 months ago, I also tried to try the same thing on a different machine but it is still not working. I assume that it could be something that changed in or in my network, but I am having a hard time figuring out what. Could someone help me with this?