error while establishing connection with node.js server OpenShift

106 views Asked by At

I am not managing to establish connection with the server is hosted in OpenShift.

the connection server is this:

var io = require ('socket.io') listen (8000);

client connection to is this one:

var socket = io.connect('http://localhost:8000');

the connection of OpenShift is this but not working:

var socket = io.connect('http://server-xatevo.rhcloud.com:8000');

the client is in my house and the server node.js this in OpenShift but can't establish a connection.

1

There are 1 answers

6
AudioBubble On

You need to listen on port 8080 on your server (but connect from your client on port 8000), you can see an example application here: https://github.com/openshift-quickstart/openshift-nodejs-http-and-websocket-example/blob/master/server.js

The full repo is available here: https://github.com/openshift-quickstart/openshift-nodejs-http-and-websocket-example