EarthScope / ringserver

Apache License 2.0
30 stars 17 forks source link

Check for an return a "SeedLink3.1" and "DataLink1.0" sub-protocols for WebSocket connections #1

Closed chad-earthscope closed 7 years ago

chad-earthscope commented 7 years ago

Currently the subprotocol for WebSocket connections, specified with the Sec-WebSocket-Protocol header is ignored. For some clients, reportedly Chrome, if a subprotocol is requested and not explicitly allowed by the server (by returning the Sec-WebSocket-Protocol header) the handshake negotiation is considered unsuccessful.

Change to search for a requested subprotocol of "seedlink/3.1" and, if present, return that same sub protocol to let the client know that it is allowed.

chad-earthscope commented 7 years ago

WebSocket subprotocols are not allowed to contain a forward slash, see discussion: https://bugs.chromium.org/p/chromium/issues/detail?id=398407

Also, the protocol matching by browsers appears to be case sensitive.

chad-earthscope commented 7 years ago

With tag v2017.052 ringserver will check for and return in the WebSocket negotiation the follow sub-protocols: /seedlink endpoint checks for and returns "SeedLink3.1" /datalink endpoint checks for and returns "DataLink1.0"

If no subprotocols are recognized or none are sent, no subprotocols are sent in the response to the client but otherwise everything is allowed to proceed.