Host a Python based Websocket server

时光毁灭记忆、已成空白 提交于 2019-12-06 03:25:21

问题


I am looking to host a basic Websocket server.

The code I want to see running is : FastFlicker

Do you know how and where I can host this application online?


回答1:


PythonAnywhere dev here. Unfortunate we can't host websocket-based apps on our site right now. The toggle you spotted enables/disables websockets for our in-browser consoles, it's not related to running your own websocket server.

I've added an upvote for websockets to our own issue tracker, but for now you'll have to use a different service :-(




回答2:


Your solution is OpenShift, even with the free plan you can host FastFlicker. Click Add Application, choose the good cartridges (Python 2.7).

Then use your gitHub repo url to get the source.

Once the application is running, you need to SSH it to change the address and the port (see this Post). To be able to ssh you need first to generate a ssh key and to add it in setting on the website

Ok, now kill all processes that uses your port. (lsof -i :8080)

Start your application and now it's working! (It is in app-deployments/current/repo/ for me, then python FastFlicker.py &)

It is currently hosted here : ws://main-fastflicker.rhcloud.com:8000/ And to test it, you know you can use this generic client..



来源:https://stackoverflow.com/questions/27402332/host-a-python-based-websocket-server

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