Skip to content

How to select sub-protocol? And related sub-protocol spec compliance issue #61

Open
@kanaka

Description

@kanaka

How do I specify what sub-protocols my application supports? I see that the WebSocketTool upgrade method takes a protocols named parameter but how do I specify that list from my application.

Also, I've noticed a spec compliance issue in the upgrade method (e.g. server/cherrypyserver.py about line 158):

if s in protocols:
    ws_protocols.append(s)

and then later:

if ws_protocols:
    response.headers['Sec-WebSocket-Protocol'] = ', '.join(ws_protocols)

While a client is allowed to specify multiple comma separated sub-protocols in the handshake request, the handshake response must only contain one of those items that the server has selected. See the /subprotocol/ description in the server handshake section: http://tools.ietf.org/html/rfc6455#section-4.2.2

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions