Openshift Online 3 with WebSockets. What is the co

2019-08-21 02:56发布

The problem is that after migrate from Openshift 2 to Openshift 3 I can't get WebSockets communication. Here is the same question but it doesn't work for me.

I've got:

Error during WebSocket handshake: Unexpected response code: 404

After refresh the same page:

Error during WebSocket handshake: Unexpected response code: 503

This is my code

var wsUri ="ws://" + document.location.host + "/scada1WebSockEndpoint"
var websocket = new WebSocket(wsUri);

And it works on my local Apache but does not work on Openshift platform. For me it looks like the websocket doesn't work at all or the wsUri incorrect. Any idea?

1条回答
Explosion°爆炸
2楼-- · 2019-08-21 03:47

Well, can't say that the problem solved, but I forced it work at least. I've just changed the type of server inside the Openshit Online 3. From Red Hat JBoss Web Server 3.0 Tomcat 8 to Red Hat JBoss Web Server 3.0 Tomcat 7. So it works now for Red Hat JBoss Web Server 3.0 Tomcat 7 on the cloud and Tomcat 8 on local PC. It means that the problem connects to Tomcat 8. But where could it be? Any idea would be appreciated.

查看更多
登录 后发表回答