websocket icon indicating copy to clipboard operation
websocket copied to clipboard

Websockets over HTTP/2

Open riking opened this issue 7 years ago • 11 comments

Is gorilla/websocket going to be doing an experimental implementation of the Websockets+h2 draft, or waiting for it to go RFC?

https://tools.ietf.org/html/draft-ietf-httpbis-h2-websockets-07

riking avatar Aug 26 '18 17:08 riking

I hadn’t seen that link! But still very early in the process, and WebSockets + HTTP/2 have been in limbo for a while. My confidence that this goes ahead in the next 6 months is low.

I can say that no work is planned, although Gary may have thought about it.

Saying all of that: we are open to design documents laying out what needs to be added and changed to support WS over HTTP/2. On Sun, Aug 26, 2018 at 10:07 AM Kane York [email protected] wrote:

Is gorilla/websocket going to be doing an experimental implementation of the Websockets+h2 draft, or waiting for it to go RFC?

https://tools.ietf.org/html/draft-ietf-httpbis-h2-websockets-07

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gorilla/websocket/issues/417, or mute the thread https://github.com/notifications/unsubscribe-auth/AABIcGGAx_3gGKGhO31_v_leTWHoFHtwks5uUtW5gaJpZM4WM3CD .

elithrar avatar Aug 26 '18 17:08 elithrar

I prefer to let the browsers lead on protocol features. Do you know where browsers are with the proposal?

If it looks like one or more browsers will implement the RFC, then the implementation should be sketched out in case changes are needed to the net/http or golang.org/x/net/http2 packages.

I don't know of any plans to do this work.

garyburd avatar Aug 26 '18 23:08 garyburd

Yes, I was alerted to this via the blink-dev Intent To Ship where they say Mozilla also intends to implement it.

Intent to Implement: https://groups.google.com/a/chromium.org/d/topic/blink-dev/TQN4jWHydTk/discussion Intent to Ship: https://groups.google.com/a/chromium.org/d/topic/blink-dev/7MCjXU3zmCQ/discussion Chrome tracking bug: https://crbug.com/801564 Firefox tracking bug: (not very active, but Intent to Ship thread contains verbal confirmation that Mozilla is working on it) https://bugzilla.mozilla.org/show_bug.cgi?id=1434137

This probably isn't shipping before the end of the year, no.

riking avatar Aug 27 '18 00:08 riking

This would require support from net/http for the CONNECT method protocol extension.

nhooyr avatar Sep 06 '18 23:09 nhooyr

Some discussion also at https://github.com/nhooyr/websocket/issues/4

nhooyr avatar Aug 21 '19 16:08 nhooyr

It's still TCP at the bottom, so there's no real point.

lxzan avatar Aug 10 '23 03:08 lxzan

It's still TCP at the bottom, so there's no real point.

It's useful for the same reason it's useful for normal HTTP requests, built in pipelining. Means you can use a single TCP connection with multiple websockets instead of having to implement your own pipelining protocol over websockets.

Certainly not a game changer but a nice addition nonetheless.

nhooyr avatar Sep 28 '23 08:09 nhooyr

It's useful for the same reason it's useful for normal HTTP requests, built in pipelining. Means you can use a single TCP connection with multiple websockets instead of having to implement your own pipelining protocol over websockets.

Certainly not a game changer but a nice addition nonetheless.

It seems to reduce performance. Does the browser client support this?

TCP Stream => H2 Stream => WebSocket Frame

lxzan avatar Sep 28 '23 08:09 lxzan

It seems to reduce performance. Does the browser client support this?

Depends on the use case.

Does the browser client support this?

Yes, browsers do support WebSockets over HTTP/2.

nhooyr avatar Sep 28 '23 08:09 nhooyr

Any updates?

meneses-matheus avatar Apr 16 '24 13:04 meneses-matheus