开发者

Socket.io handler using Gevent / Tornado & Flask

开发者 https://www.devze.com 2023-04-06 20:55 出处:网络
can anyone show me and example of how to handle a generic socket.io connection (depends on the client browser, could be websockets, or xhr-longp开发者_高级运维olling, etc..) using gevent and flask, or

can anyone show me and example of how to handle a generic socket.io connection (depends on the client browser, could be websockets, or xhr-longp开发者_高级运维olling, etc..) using gevent and flask, or maybe flask with tornado as an async server thank you


TornadIO works well enough with stable version of socket.io (0.6), it integrates into any Tornado-powered application as a common request handler, wrapped around class with socket events callbacks. Works pretty stable.

But I'd recommend not to use the provided SocketServer class and just configure correctly the common HTTPServer of Tornado, just take a look at SocketServer implementation as a guideline.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号