Tag: ws4py

Websocket(Python 3.5中的ws4py)不能在Docker容器中工作

我有一个简单的Web应用程序,它使用CherryPy作为RESTful后端,ws4py作为websockets。 1) Javascript client sends a POST to Python backend 2) Python replies with a unique id 3) Javascript connects to the websocket and sends the unique id 4) Python associates the websocket client connection to the unique id Python websocket代码: class WebSocketHandler(WebSocket): def __init__(self, *args, **kw): WebSocket.__init__(self, *args, **kw) print('Connected to websocket server!') SUBSCRIBERS.add(self) […]