Opened 5 weeks ago

Last modified 5 weeks ago

#1992 new enhancement

Websocket over HTTP/2 support

Reported by: ckmichael8@… Owned by:
Priority: minor Milestone:
Component: nginx-module Version: 1.19.x
Keywords: Cc:
uname -a:
nginx -V: latest

Description

Hello,

Will NGINX ever support Websocket over HTTP/2?

https://tools.ietf.org/html/rfc8441

Change History (1)

comment:1 by Maxim Dounin, 5 weeks ago

First of all, two basic things to understand:

  1. nginx does not talk Websocket protocol by itself, but rather provides a way to proxy HTTP/1.1 connection upgrades to backends;
  2. RFC 8441 defines a completely different way to establish websocket communication, using a CONNECT method.

Support for Websockets over HTTP/2 basically means that nginx will have to translate these CONNECT requests to HTTP/1.1 Upgrade requests somehow when proxying. While this might work, this doesn't look like a good solution.

Alternatively, we may consider passing such CONNECT requests as is to HTTP/2 backends (for example, when using grpc_pass), but this approach also have problems. In particular, this doesn't look compatible with HTTP/1.1 backends, which makes it hardly useful.

Overall, this is unlikely to happen unless there is a practical demand. For now it looks like there is no such demand.

For there record, it RFC 8441 currently seems to work somehow in Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=1434137) and under a flag in Chrome (https://www.chromestatus.com/feature/6251293127475200).

Note: See TracTickets for help on using tickets.