How can I set the port WebSocket will be listening on? I'm trying to deploy Meteor on OpenShift, but there they have a nodejs-proxy server that listen on port 8000 instead 80, and redirect to my Meteor daemon. It is working since a manually created WebSocket object works fine.
I've set ROOT_URL but without success. It appears on the browser as defined bellow:
process.env.ROOT_URL = 'http://' + process.env.OPENSHIFT_APP_DNS + ':8000'
I'm using this quickstart: https://github.com/openshift-quickstart/openshift-meteorjs-quickstart. See file meteorshim.js for reference.
Everything works fine, including long-polling.
I struggled with this for a while now and I tried different things. The solution that worked for me in OpenShift was this:
Set the DDP_DEFAULT_CONNECTION_URL variable
//for http
process.env.DDP_DEFAULT_CONNECTION_URL = 'http://' + process.env.OPENSHIFT_APP_DNS + ':8000'
//for ssl
process.env.DDP_DEFAULT_CONNECTION_URL = 'https://' + process.env.OPENSHIFT_APP_DNS + ':8443'
According to this blog post
Just use the environmental variable PORT
so I guess:
process.env.PORT = 8000
process.env.ROOT_URL = 'http://' + process.env.OPENSHIFT_APP_DNS
To set websockets on a different port specifically and have meteor run on a different port I'm not too sure this is possible yet.