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?
Edit: I have also tried
http://127.0.0.1:3000
Server side socket:
let server = app.listen(port);
let io = require('socket.io').listen(server);