客户端无法使用gevent-websocket连接到服务器websocket

时间:2015-05-24 19:59:24

标签: javascript python websocket gevent

我正在尝试使用gevent-websocket将数据从后台服务器应用程序流式传输到客户端Web页面。

当使用localhost或离开时('',8999)我能够连接到Web套接字,但是当尝试从服务器上访问时,我似乎无法连接错误{{ 1}}

我尝试过其他具有相同问题的浏览器(我也尝试过使用chrome)

'Firefox can't establish a connection to the server at ws://SERVER-IP:8999/.'

正如我所说,我已经尝试将其留空了 - 放入def app(environ, start_response): ws = environ['wsgi.websocket'] stream_listener.add_socket(ws) while not ws.closed: gevent.sleep(0.1) server = pywsgi.WSGIServer( ('0.0.0.0', 8999), app, handler_class=WebSocketHandler) server.serve_forever() 希望将它绑定到所有接口,但仍然没有运气。

以下是适用于'0.0.0.0'的客户端脚本 - 但尝试放入localhost失败。

SERVER-IP:8999

0 个答案:

没有答案
相关问题