[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

How to make a port accessible out of the gear in online?



Hi,
Recently I am trying to run a python application on OpenShift. It uses Redis and WSGIServer from gevent.wsgi. So I created a python app and then followed the link [1] and link [2]. I just commented out the httpd = make_server('localhost', 8051, application) and httpd.handle_request() in wsgi.py and make the app to listen on port like this:
ip = os.environ['OPENSHIFT_PYTHON_IP']
port = int(os.environ['OPENSHIFT_PYTHON_PORT'])
http_server = WSGIServer((ip, port), app)

However, if I access directly from the browser using
https://dm-qihang.rhcloud.com/
I will always get 404. But if I use port-forward to make it accessible by 127.0.0.1:8080, it works well. So I wonder if this is a bug with something or I missed some steps?

FYI, I pushed the whole app to github[3].

Thanks.

[1] https://blog.openshift.com/enabling-redis-for-your-app/
[2] https://developers.openshift.com/en/python-getting-started.html
[3] https://github.com/sztsian/gdanmaku-openshift
--
Zamir SUN
zsun fedoraproject org
zsun in #fedora-zh #openshift on freenode.net


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]