Open yschimke opened 6 years ago
Been following this from the HYBI mailing list. I wish they'd address more of the design flaws of the protocol as part of this.
Is the idea you use existing connections you probably have (e.g. webbrowser opened when getting HTML + JS). Just curious for service usage, are you meant to try HTTP/2, see if supported then re-establish with HTTP/1.1 if not?
I haven't been paying that close attention so I'm not sure. Mostly just interested in it because web sockets are giant inefficient balls of terrible with the XOR-ing of bytes and the need for a dedicated connection. This at least aims to solve the second problem.
On second thought I think that's what I like about the spec. It isn't actually anything specific to websockets, it's just socket (bidirectional streams) over HTTP/2. ALPN over HTTP/2.
They just chose this registry https://www.iana.org/assignments/http-upgrade-tokens/http-upgrade-tokens.xhtml
over this one https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
Great way to get secure tunnels supported in an almost undetectable and unstoppable way. Great for the dissidents of the world.
Implementation wise, generalising RealWebSocket.Streams looks really doable.
When support?
Very early PR is here, but I haven't started on HTTP/2 parts yet, just refactoring with HTTP/1.1. It's not my day job, but I hope I'll have a chance to push forward on it in next week or so.
Realistically it won't be in 3.11, so maybe experimental support in 3.12 is more likely.
@crossle do you know any servers that already support this?
@yschimke Sorry, before we developing server use WS over HTTP/2, but okhttp not support, so we switch to HTTP/1.1, 😅
libwebsockets supports rfc8441 so websockets-over-http2 becomes viable option if primary clients are native mobile. I have netty based impl of both server and client https://github.com/jauntsdn/netty-websocket-http2 that should work on android without much modifications, though It would be nice to have client implemented here given okhttp is dependency of every mobile project.
https://www.chromestatus.com/feature/6251293127475200
Status in Chromium
Blink components: Internals>Network>HTTP2
Enabled by default (tracking bug) in:
Chrome for desktop release 91
Chrome for Android release 91
Android WebView release 91
Unless anyone is moving on this, I'll likely take a look over the christmas period.
https://tools.ietf.org/html/draft-ietf-httpbis-h2-websockets-00