Clone of https://bitbucket.org/Jeffrey/gevent-websocket/