I created an app with NodeJS and I\'m using ws module. If I test the app in localhost it works and there isn\'t any problem to connect websockets. Now I\'ve upload the app t
For all WebSocket connections on OpenShift you need to use port 8000
(for Secured sessions it would be 8443
). So, your server example works well (I run them after removing the unnecessary line var Enum = require('enum');
, you just need to hardcode the port on client to 8000
:
var ws = new WebSocket("ws://YourApp-YourName.rhcloud.com:8000");
ws.onopen = function(){
console.log('opened')
}
More information here.
Here is an example on github that works that you can check out: https://github.com/developercorey/openshift-nodejs-http-and-websocket-example