Open albertas opened 4 years ago
Hi @albertas. Thanks for the report. Looks like we need to update for the 2.1 version of the websockets spec. Fancy adding handling there?
Sure, I will try adding "headers" section support myself. However, I don't know what are other changes in 2.1 websocket spec, hence they will be out of my PR scope.
Hey @albertas: no problem! Getting one thing at a time is plenty (but I think headers
was the only change IIUC).
I want to add
permessage_deflate
Websocket extension support fordjango_channels
consumer/server. Server has to provide supported extensions in the headers of handshake response, e.g.Sec-Websocket-Extensions: permessage-deflate
. ASGIREF documentation states, that"headers"
section is supported for"websocket.accept"
message type. Hence, I have tried to accept Websocket connection with this code:However, the daphne server ignores the
"headers"
section of this message and only uses"subprotocol"
section: https://github.com/django/daphne/blob/master/daphne/ws_protocol.py#L185That means, that Daphne server has no way to inform client, that it supports some kind of Websocket extensions, which is a major limitation.
pip freeze: