Openshift Tornado WebSocket (Demo) not responding

I am trying to host a websocket application in python in openshift. I found this repo: https://github.com/ramr/openshift-tornado-websockets , which uses a tornado for websocket and regular HTTP connection, I want to deal with ws and http, I successfully deployed the code over openshift. according to the code associated with the default 8000 internal port with opening, but when I tried to connect to ws: //piot-cloudap.rhcloud.com: 8000 / ws-echo / url end using python websocket client lib it connects to the ws url, but when I try to send some data and then try to get it back, it returns nothing but an empty string, can someone tell me what I'm doing wrong!

client code that is used:

ws = create_connection("ws://piot-cloudap.rhcloud.com:8000/ws-echo/") ws.send("test") result = ws.recv() print result 

But it returns null.

Any help would be appreciated.

+1
source share
1 answer

You need to bind to port 8080 in your application, but users get access to it on port 8000 from the outside. Also make sure that you bind to your openshift ip address. You can refer to this page ( https://developers.openshift.com/en/managing-port-binding-routing.html ) of the developer portal for more information on how requests are redirected to your application.

0
source

Source: https://habr.com/ru/post/1208736/


All Articles