user3114495
user3114495

Reputation: 51

How can I access socket through Openshift

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.

Upvotes: 4

Views: 1544

Answers (2)

minghua
minghua

Reputation: 6613

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.

Upvotes: 0

niharvey
niharvey

Reputation: 2807

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

Upvotes: 1

Related Questions