You can look at using TornadIO. Its a
python implementation of Socket.io, for
Tornado, Tornado is an event-driven python web
server.
https://github.com/MrJoes/tornadio2
http://www.tornadoweb.org/
Socket.io is a cross-browser solution to socket/socket-
like connections from the web client to the server. This will pretty much give
you all the tools you need to do a chat server since it supports pub-sub
subscriptions and messages. The nice thing about using socket.io for your
purposes is that it tries a number of transports in order to ensure that new
and old browsers can all communicate: Websocket, Flashsocket, xhr polling,
jsonp, htmlfile. They all are attempted and used in a way that looks the same
to the client.
Tornadio2 is the newer version that is compatible with the newer Socket.io
0.7+. This version added a lot of features that broke compatibility with 0.6.
However, the original TornadIO contains a chatroom example which you could
review and translate pretty easily to the newer version to get you started:
https://github.com/MrJoes/tornadio/tree/master/examples/chatroom
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)