Open meejah opened 6 years ago
(But also: does websocket even make any sense at all on http/2? There's no spec yet AFAIK .. but we should still fail more gracefully here)
no, there is no websocket-over-http, and we don't need it, since we take over the complete transport (everything above TLS)
Right, I'm talking about our twisted Resource that takes over the HTTP transport. It doesn't work at all if e.g. you have h2 installed because then it uses HTTP2 and request.transport
is None
in that case so the takeover just blows up.
Ah, ok. Yes, I think I only tested Universal Transport, which works, because it can split off WebSocket/RawSocket before Twisted Web. But for Web Transports, Twisted Web is in charge (first), and yes, it would be great to have a supported method/way in Twisted to take over transports for us to use, so we don't have to come up with hacks like this that break at some point ..
See https://github.com/crossbario/autobahn-python/issues/1064#issuecomment-432932099
It seems that our method of "taking over" a transport doesn't work nicely for HTTP/2 connections (
.transport
isNone
in those cases, and.channel
seem to probably be the right thing to take over). Needs some more investigation