Open nworbnhoj opened 2 years ago
I like the idea of supporting sub protocols in the framer module but I don't think your implementation would work for all use cases.
I would be better to pass in the chosen websocket sub protocol as follows:
sec_websocket_key: &WebSocketKey,
sec_websocket_protocol: Option<&WebSocketSubProtocol>,
It seem odd that this call to server_accept forces websocket_protocol to None.
The change proposes a slightly less blunt approach of defaulting to WebSocketContext.sec_websocket_protocol_list[0]
This probably should also include doco for the Server implmentation.