Meteor: Workaround for having websockets blocked in port 80?

601 views Asked by At

I am having problems with a Meteor app. Some smartphones are not receiving data from subscriptions when they are connected via 3G/4G but they work properly when connecting via Wi-Fi. I think it is because Vodafone (a mobile network operator) is blocking websocket connections to port 80.

Is it possible to change the DDP port? Does anyone have a workaround to make it work?

I have tried changing the environment variable "DDP_DEFAULT_CONNECTION_URL": "ddp+sockjs://xxxxxx.com:443/sockjs" but it breaks the app for all devices and throws the following error:

GET http://0.0.1.187/sockjs/info?cb=23ctb533n5 net::ERR_ADDRESS_UNREACHABLE

Thank you very much for your help and time!

1

There are 1 answers

1
Fernando César On

This should work out-of-the-box in Meteor, since the engine supposedly falls back to a backup technology (AJAX+JSON) if WebSockets fail. However, I had the same issue and still couldn't figure out why this wasn't automagic.

You can however force this behavior with

DISABLE_WEBSOCKETS=1 

From here: http://www.meteorpedia.com/read/Websockets