How can I access socket through Openshift

我与影子孤独终老i 提交于 2019-12-01 04:24:30

问题


I register in the Openshift.com and create a catridge. But when I need to deploy Mosquitto, a MQTT Server, which is accessed through tcp or ssl protocol, and I need visit from public IP. Does Openshift just redirect http/https protocol through 80/443 port to 8080? Is it possible to use socket communcation in Openshift?

I have created two applications in Openshift, one for push and the other for web deployment, and I stopped the apache service in order to let the mosquitto service listen to 8080. But only if I send post request in https protocol, It can access to the server for a while and disconnect.


回答1:


I think this might point you in the right direction https://www.openshift.com/blogs/paas-websockets.




回答2:


To save some readings from the readers, the steps involved in niharvey's answer:

  • Create a diy app in your openshift account.
  • Git checkout the code.
  • Add a websocket app of your own choice that would bind to $OPENSHIFT_DIY_IP:$OPENSHIFT_DIY_PORT.
  • Modify the action hooks for starting and stopping your app. Push the code.
  • From the client, connect to port 8000 for ws:// or 8443 for wss://, by your app url.

Just verified these steps do work as expected.



来源:https://stackoverflow.com/questions/20654119/how-can-i-access-socket-through-openshift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!