您可以尝试使用Tornado web服务器。 Tornado具有WebSockets实现。 请参见http://bret.appspot.com/entry/web-sockets-in-tornado。