我刚刚在我的 openshift 帐户 (tomcat-ngoanhtuanthesis.rhcloud.com/) 上成功安装了 Apache Tomcat 7.0.39。我知道tomcat 7.0.39已经支持Websocket了。在我的本地计算机上,我可以正常运行我的 web 套接字应用程序,但我无法在 openshift 服务器上运行它。但是,我的 Web 服务应用程序可以运行得很好。我已经在互联网上搜索了整个星期,但找不到任何解决方案。谁能帮我?提前致谢!
注意:这是我的 Web 服务:
tomcat-ngoanhtuanthesis.rhcloud.com/TrueTrafficServerAlpha2/
这里是 Tomcat 7.0.39 中集成的一些 websocket 示例。这些示例即使非常简单也无法运行。
http://tomcat-ngoanhtuanthesis.rhcloud.com/examples/websocket/
最佳答案
你读过这个吗? https://www.openshift.com/blogs/paas-websockets
WebSockects 目前正在 openshift 上暂存,并可在其他端口上使用。
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
因此,只需在此处打开您的示例,它们就会正常工作(希望如此):
https://tomcat-ngoanhtuanthesis.rhcloud.com:8443/examples/websocket/
关于java - Openshift 上 Tomcat 7.0.39 上的 Websocket,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16130438/