-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebSockets over HTTP/2 #4
Comments
Definitely worth reading https://tools.ietf.org/html/rfc8441 |
This does mean we cannot expose net.Conn directly as part of the API interface like gorilla/ws because there may not be a net.Conn to expose. |
So unfortunately, there is no clean way for a client to detect whether a HTTP server supports WebSockets over HTTP/2 without actually performing a handshake. I've emailed the working group regarding this. |
Hopefully shows up on https://lists.w3.org/Archives/Public/ietf-http-wg/2019AprJun/ |
So it looks like my suggestion won't be implemented. The only way to implement this then is to take a HTTP2 flag on the dial options or keep a global cache. For the server, I'm sure we can do this transparently but will require some collaboration with net/http. |
Could probably implement this reasonably quickly if we forked x/net/http2.
|
Hi, I have been building a similar websocket package, and would be willing to help if I can. Some things I can share:
I see you on some of the related threads, so some of this is just to provide context to anyone else reading this issue thread. |
Nice.
I think it should be fine. A RFC 8441-complaint reverse proxy would translate HTTP/2 over web sockets into HTTP/1.1 for the origin server. e.g. Nginx translates all HTTP/2 requests into HTTP/1.1 for origin servers. Otherwise it wouldn't be RFC 8441-complaint if it just proxied the request directly.
Yea that is unfortunate. Maybe a new field on
Awesome, would love your help :) So then the remaining items here are:
|
See my proposal at golang/go#32763 (comment) to make net/http transparently handle http/2 upgrades server side and client side. Would be much nicer than implementing it here as all Go WebSocket server's would work over HTTP/2 and we would get client side support for free as we use net/http's Client directly. |
Hi... is there a workaround that can be used until go supports something in that direction? |
@hons82 Unfortunately apart from forking the go net/http library nope. I don't think it'd be very difficult to implement but there just hasn't been a response from the Go team on the linked issue. |
@nhooyr Any further updates or progress on this? |
I'm full time on websocket the next few months. There hasn't been any movement on the Go issue but I think I'll just fork net/http and implement my proposal linked above there. Then people can use my fork if they want WebSockets over http/2 with my library. As well I'll open a CL on the standard library with my proposal so hopefully my fork won't be necessary. These things don't tend to get moving on issue trackers unless someone shows the initiative by implementing and demonstrating the demand. |
I believe the link was meant to be #402 |
Have you seen golang/go#49918? |
Also golang/go#53209 and golang/go#53208. |
Nope, I missed those thanks for the links! |
That would be awesome |
Blocked on the drafts and Go support.
The text was updated successfully, but these errors were encountered: