GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Websocket over HTTP2 · Issue #8011 · netty/netty

Websocket over HTTP2 #8011

New issue
Copy link
New issue
Copy link
Open
#18574
Open
Websocket over HTTP2#8011
#18574
Copy link

Description

@re-thc
re-thc
opened on Jun 8, 2018
Issue body actions

Hi, as per https://www.chromestatus.com/feature/6251293127475200 (think Firefox is looking into this too) is an enhancements to have Websockets served over HTTP2. Can this feature please be implemented?

https://tools.ietf.org/id/draft-mcmanus-httpbis-h2-websockets-00.html

Extracting the justification:

A server offering both HTTP/1.1 and WebSocket services can do so from the same instance and same port although they require separate TCP connections. Moving a server to HTTP/2 and WebSocket services requires a separate port and protocol stack for the sole purpose of bootstrapping WebSockets. This is a significant administrative burden and may not even be possible in the case of large amounts of deployed markup pointing at the old single name and port. Being able to bootstrap WebSockets from HTTP/2 allows one server, one port, and one TCP connection to be shared by both protocols.

Reacted by KC, Thayne McCombs, Yakiv Yereskovskyi, marcel-sebek-dbag and He-Pin(kerr)

Activity

  1. normanmaurer commented on Jun 13, 2018

    @normanmaurer
    normanmaurer
    on Jun 13, 2018
    Member
    More actions

    @hc-codersatlas we love contributions that said its a draft 00 so maybe a bit early for it.

  2. rschmitt commented on Jul 28, 2018

    @rschmitt
    rschmitt
    on Jul 28, 2018
    More actions

    The latest draft of the spec is available here.

  3. seamlik commented on Jan 20, 2019

    @seamlik
    seamlik
    on Jan 20, 2019
    More actions

    (think Firefox is looking into this too)

    Will be supported by Firefox 65.

  4. rnd4222 commented on May 22, 2019

    @rnd4222
    rnd4222
    on May 22, 2019
    More actions

    Given that it is no longer a draft, is there any chances it would be implemented in netty?

  5. normanmaurer commented on May 22, 2019

    @normanmaurer
    normanmaurer
    on May 22, 2019
    Member
    More actions

    @rnd4222 we love contributions... so if you feel you have the cycles go ahead. I am not sure when I will have time to look into it.

  6. infoLightspace commented on Nov 7, 2019

    @infoLightspace
    infoLightspace
    on Nov 7, 2019
    More actions

    Am up for the challenge. Am going through the draft.

  7. mostroverkhov commented on Jul 30, 2020

    @mostroverkhov
    mostroverkhov
    on Jul 30, 2020
    Contributor
    More actions

    for @hc-codersatlas and others interested in topic - recently I've experimented with rfc8441, and sharing results on https://github.com/jauntsdn/netty-websocket-http2

  8. riyafa commented on Jan 31, 2022

    @riyafa
    riyafa
    on Jan 31, 2022
    Contributor
    More actions

    @mostroverkhov why is this not a PR to netty?

  9. glennosss commented on Apr 30, 2022

    @glennosss
    glennosss
    on Apr 30, 2022
    More actions

    I recently implemented this, surprisingly with minimal effort. The hardest part of implementing was interestingly more due to how the current Websocket over HTTP/1 code was structured.

    Current websocket code needs refactoring

    The current Websocket over HTTP/1 code is overly coupled to HTTP/1 HttpRequest/etc.

    It's fairly straight forward to separate the Websocket code so that it's separate from the HTTP/1 and HTTP/2 specific parts.

    Websockets over HTTP/2

    The first pull request someone should send in is simply to add;

    • public static final char SETTINGS_ENABLE_CONNECT_PROTOCOL = 8; to Http2CodecUtil
    • update Http2Settings to support this constant.

    Adding this constant is the first step to adding Websocket over HTTP/2 support to netty. And if the previous refactoring is done, and some example code was provided, I don't think most people would have trouble enabling HTTP/2 websockets themselves.

    The weirdest thing I found about Websockets over HTTP/2 is Chrome only establishes them if there's a current HTTP/2 connection it can multiplex over. If the server restarts or Chrome loses it's connection to the webserver, then Chrome will immediately (and annoyingly) default back to a HTTP/1 websocket connection. This means you must have a websocket server that also supports at least one HTTP request in order to support HTTP/2 websockets (further support for the argument that you shouldn't "optimistically setup your pipelines").

  10. glennosss commented on May 1, 2022

    @glennosss
    glennosss
    on May 1, 2022
    More actions

    @normanmaurer I'm recommending that two new incubator projects be created and wanted your thoughts.

    Summary;

    • Websockets over HTTP/1; https://datatracker.ietf.org/doc/rfc6455/ (supported by chrome)
    • Websockets over HTTP/2; https://datatracker.ietf.org/doc/rfc8441/ (supported by chrome)
    • Websockets over HTTP/3; https://datatracker.ietf.org/doc/draft-ietf-httpbis-h3-websockets/ (no chrome support yet)
    • WebTransport over HTTP/2; https://datatracker.ietf.org/doc/draft-ietf-webtrans-http2/ (no chrome support yet)
    • WebTransport over HTTP/3; https://datatracker.ietf.org/doc/draft-ietf-webtrans-http2/ (supported by chrome)

    Ultimately in the future clients will prefer to connect using WebTransport (only supported by HTTP/3 for now), but fall back to Websockets if necessary.

    I think the following repos should be created;

    • https://github.com/netty/netty-incubator-codec-websockets
    • https://github.com/netty/netty-incubator-codec-webtransport

    Current state

    [netty-codec-http] contains "io.netty.handler.codec.http.websocketx" package.

    Future state: netty-incubator-codec-websockets

    [netty-codec-websockets-http1] initially containing copy of "io.netty.handler.codec.http.websocketx" package.
    [netty-codec-websockets-http2]
    [netty-codec-websockets-http3]
    [netty-codec-websockets-common] Most of the code for WebSocketFrame's/etc will be moved here. But with no dependency on netty-codec-http, netty-codec-http2 or netty-codec-http3.

    Eventually remove "io.netty.handler.codec.http.websocketx" package from netty-codec-http.

    Future state: netty-incubator-codec-webtransport

    [netty-codec-webtransport-http2]
    [netty-codec-webtransport-http3]
    [netty-codec-webtransport-common]

  11. KingMob commented on Oct 16, 2023

    @KingMob
    KingMob
    on Oct 16, 2023
    More actions

    What's the status of this?

    According to https://wpt.fyi/results/websockets/opening-handshake/002.html%3Fwpt_flags%3Dh2?label=experimental&label=master&aligned, RFC 8441 is now supported by all browsers other than Safari.

    @mostroverkhov Have you considered making your repo a PR to netty?

    Reacted by clayly and Yakiv Yereskovskyi
  12. clayly commented on Dec 16, 2023

    @clayly
    clayly
    on Dec 16, 2023
    More actions

    We've also been seeing a trend of more 400 errors lately, perhaps clients are trying http2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.