托管基于Python的Websocket服务器 [英] Host a Python based Websocket server

查看:108
本文介绍了托管基于Python的Websocket服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个基本的Websocket服务器.

I am looking to host a basic Websocket server.

我想看到正在运行的代码是: FastFlicker

The code I want to see running is : FastFlicker

您知道我可以如何在哪里托管该应用程序吗?

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

推荐答案

您的解决方案是 OpenShift ,即使有免费计划,您也可以托管 FastFlicker . 点击添加应用程序,选择合适的墨盒(Python 2.7).

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

然后使用您的gitHub存储库网址获取源代码.

Then use your gitHub repo url to get the source.

应用程序运行后,您需要对其进行SSH更改以更改地址和端口(请参见此帖子). 为了能够使用SSH,您需要先生成ssh键,并将其添加到网站上的设置中

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

好吧,现在将使用您端口的所有进程杀死.(lsof -i :8080)

启动您的应用程序,现在可以使用了! (对我来说,在app-deployments/current/repo/中,然后在python FastFlicker.py &中)

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

它当前在这里托管:ws://main-fastflicker.rhcloud.com:8000/ 要进行测试,您知道

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

这篇关于托管基于Python的Websocket服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆