Closed
Description
What version of Go are you using (go version
)?
go version go1.16.4 linux/amd64
Does this issue reproduce with the latest release?
Yes.
What did you do?
I wanted to use Websockets over HTTP2.
What did you expect to see?
That HTTP2 ResponseWriter supports Hijacker.
What did you see instead?
That it does not. Exploring this more, it looks like it is on purpose:
- x/net/http2: *http2responseWriter does not implement http.Hijacker #14797
- net/http: document explicitly that http2 doesn't support Hijacker #15312
But since then, WebSockets over HTTP2 have been standardized and Firefox and Chromium supports that. Thus, I suggest that now HTTP2 ResponseWriter should supports Hijacker so that one can use Websockets over HTTP2. The server should also be able to specify using HTTP/2 SETTINGS parameter that it supports Websockets over HTTP2.