"subprotocols" key should be built from Sec-WebSocket-Protocol header value. Currently it's always empty.
scope = {
"type": "websocket",
"headers": flatten_headers(headers),
"path": path,
"query_string": query_string_bytes,
"root_path": "",
"scheme": "http",
"subprotocols": [],
}