In my web application, I use Node.js and Socket.io.
Since I am testing the application locally or on my Wi-Fi network, everything was fine, but since I switched to mobile data, I received a connection error:
WebSocket connection for 'WS: //url/socket.io/1/websocket/' failed: WebSocket handshake error: Unexpected response code: 502
It seems like my mobile provider is blocking ports 8080 and 80, but switching to another port seems impossible with nodejitsu.
Does anyone have experience with a mobile network, Node.js and socket.io?
EDIT:
As a host, I tried a free Heroku subscription and a Nodejitsu free subscription.
On a mobile device, I checked the ports at http://websocketstest.com/ with a mobile phone and Wi-Fi. On a mobile device, the test failed with ports 80 and 8080.
I thought maybe I can change the port to 443, but nodejitsu seems to be listening on port 80, even if I installed server.listen()
on port 443.
I think that WebSockets may be possible, maybe through a different port, but I donβt know how to change the port or why nodejitsu, for example, just listens on port 80.
source
share