简体   繁体   中英

Websocket on Tomcat 7.0.39 on openshift

I've just successfully installed Apache Tomcat 7.0.39 on my openshift account (tomcat-ngoanhtuanthesis.rhcloud.com/). I know that tomcat 7.0.39 has supported Websocket. In my local computer, I can run my web socket aplication properly, but I cannot run it in the openshift server. However, my web service application can run very well. I've searched over the Internet for the whole week but I couldn't find any solution. Can anyone help me? Thank you in advance!

Note: here is my Web service:

tomcat-ngoanhtuanthesis.rhcloud.com/TrueTrafficServerAlpha2/

And here are some websocket examples integrated in Tomcat 7.0.39. These examples cannot run even though they are very simple.

http://tomcat-ngoanhtuanthesis.rhcloud.com/examples/websocket/

Did you read this? https://www.openshift.com/blogs/paas-websockets

WebSockects are currently under staging on openshift, and are available on alternative ports.

How to access Preview WebSockets Support?

You will need to connect to specific ports, as the main routing layer is still Apache based and does not support WebSockets.

So, for plain WebSockets ws:// you will use port 8000 and for secured connections wss:// port 8443. Here's an example:

http://app-lovingwebsockets.rhcloud.com/ <= your current HTTP URL

http://app-lovingwebsockets.rhcloud.com:8000/ <= WebSockets enables HTTP URL

https://app-lovingwebsockets.rhcloud.com/ <= your current HTTPs URL

https://app-lovingwebsockets.rhcloud.com:8443/ <= WebSockets enables HTTPs URL

So, just open your samples here, and they will just work (hopefully):

https://tomcat-ngoanhtuanthesis.rhcloud.com:8443/examples/websocket/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM