socket.io not connecting to mobile browser

user3152094 picture user3152094 · Jan 2, 2014 · Viewed 8.3k times · Source

I wanna create a connection between my mobile Safari and nodejs + socket.io on my Macbook.

When i call localhost:8080 from my laptop, everything works fine. The console says that the client is connected and my little website is displayed.

When i call it over my mobile browser with 10.0.1.5:8080, the website is displayed as well, but my socket.io don't identify the mobile browser (iPhone) as client and nothing happens on the console board.

Does anybody where the problem is?

Answer

dotcomXY picture dotcomXY · Feb 9, 2014

I found this post on SO, probably can help you out. why does my nodejs socket.io app not work on ios6

Localhost is local to the machine. You're IP should use a ip address or domain name:

something like: io.connect('192.168.1.110'); or io.connect('test.myapp.com');