How to install Meteor WebSocket port for clients?

How can I configure the port that WebSocket will listen on? I'm trying to deploy Meteor to OpenShift, but there they have a nodejs proxy server that listens on port 8000 instead of 80 and redirects my Meteor daemon. It works because the manually created WebSocket object is working fine.

I set ROOT_URL, but to no avail. It is displayed in the browser as follows:

process.env.ROOT_URL = 'http://' + process.env.OPENSHIFT_APP_DNS + ':8000' 

I use this quick start: https://github.com/openshift-quickstart/openshift-meteorjs-quickstart . See the meteorshim.js file for help.

Everything works fine, including a lengthy survey.

+1
javascript port websocket meteor
source share
2 answers

I struggled with this for a while, and I tried different things. The solution that worked for me in OpenShift was this:

Set the variable DDP_DEFAULT_CONNECTION_URL

 //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

+6
source share

Just use the PORT environment variable

therefore I assume:

 process.env.PORT = 8000 process.env.ROOT_URL = 'http://' + process.env.OPENSHIFT_APP_DNS 

To set up Web sites on another port, as well as run a meteorite on another port, I'm not sure if this is possible.

0
source share

All Articles