referring to localhost despite being set as a specfic IP


I'm trying to use web sockets to connect from a Google Chrome browser on my phone to a server running node.js and

Using the remote debugging tool in Google Chrome I get this error in the console

Failed to load resource http://localhost/

This happens despite me specifying my internal LAN IP in code for the client like so:

var socket = io.connect('');

Furthermore it seems like the first heartbeat request makes it but starts to fail after that.

The client requests The code runs as expected when running the client on the server.

Problem courtesy of: Kristjan Oddsson


I am of course a idiot. I had another javascript file that had not been updated to connect to the specific IP I had set and was still set to "localhost".

After updating the host that should connect to in that javascript file everything is now running smoothly :)

Solution courtesy of: Kristjan Oddsson


There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.