njoyce/gevent-websocket — pull request #3 by ericem (2013-07-24 17:50:15+00:00)
Title: Initial implementation of subprotocol negotation

Here is a simple implementation of sub-protocol negotiation as defined in the RFC 6455 section 1.9. It does not implement any particular protocol but merely provides a hook function, register_protocol, so that you can register a subprotocol name for negotiation when a client connects. If the client and server agree on a subprotocol, then the wsgi environ variable 'wsgi.websocket_protocol' is set with the name of the subprotocol that was agreed upon. I am working on a WAMP implementation that I will publish separately that uses this mechanism.