Thursday, 11 May 2017

Cordova Socket.Io connection refused localhost:3000

I have a local node project running on localhost:3000 and it also has socket.io available for use. If I deploy the project to heroku and use

var socket = io.connect('http://herokuapss....'); 

and the cordova app to my phone it will work perfectly. I don't want to keep deploying to my phone, so I decided to use the localhost node project and an emulator. Therefore I change the socket to

var socket = io.connect('http://localhost:3000/');

But when I start the app on the emulator I see this in the console:

http://localhost:3000/socket.io/?EIO=3&transport=polling&t=LlvgDEL Failed to load resource: net::ERR_CONNECTION_REFUSED

How can I solve this?



via Bogdan Daniel

No comments:

Post a Comment