Support WebSockets over HTTP/2 via RFC 8441 Extended CONNECT
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Tranquilo
- Stack tecnológico
- scala
- Área
- api, backend, networking
Línea de trabajo
Comienza revisando las API existentes WebSocketUpgrade y handleWebSocketMessages y, a continuación, sigue el procesamiento de HTTP/2 conforme a RFC 8441. Define cómo deben integrarse SETTINGS_ENABLE_CONNECT_PROTOCOL, Extended CONNECT, HTTP/2 status 200, el flujo de frames y la terminación del stream con la pila de mensajes WebSocket existente. Se considera terminado cuando haya una API y un comportamiento del lado del servidor acordados, con cobertura para streams WebSocket HTTP/2 aceptados y terminados.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
Pekko HTTP supports HTTP/2 and WebSockets, but WebSocket support currently appears to be limited to the classic HTTP/1.1 upgrade handshake.
RFC 8441 defines how to bootstrap WebSockets over HTTP/2 using Extended CONNECT:
- server advertises
SETTINGS_ENABLE_CONNECT_PROTOCOL = 1 - client sends
:method = CONNECT - client sends
:protocol = websocket - request also includes
:scheme,:path, and:authority - server accepts with
:status = 200 - WebSocket frames are then carried over the HTTP/2 stream
This would allow applications to serve HTTP/2 requests and WebSockets on the same HTTP/2 connection instead of falling back to a separate HTTP/1.1 WebSocket upgrade connection.
RFC: https://www.rfc-editor.org/rfc/rfc8441.html
Current Behavior
Pekko HTTP WebSocket handling is based on the HTTP/1.1 upgrade model:
- request validation expects
Upgrade: websocket,Connection: Upgrade,Sec-WebSocket-Key, andSec-WebSocket-Version - accepted WebSockets return
101 Switching Protocols - the existing
WebSocketUpgradeAPI represents upgrading the connection to WebSocket
That matches RFC 6455 over HTTP/1.1, but not RFC 8441 over HTTP/2.
Expected Behavior
When HTTP/2 is enabled, Pekko HTTP should optionally support RFC 8441 WebSockets over HTTP/2.
At a high level this likely means:
- advertise
SETTINGS_ENABLE_CONNECT_PROTOCOL = 1when server-side support is enabled - accept HTTP/2 Extended CONNECT requests with
:protocol = websocket - expose those requests to routing / low-level APIs similarly to existing WebSocket upgrade requests
- allow existing
handleWebSocketMessages/WebSocketUpgradestyle APIs to work where practical - respond with HTTP/2
:status = 200when the WebSocket is accepted - connect the existing WebSocket frame/message stack to the HTTP/2 stream DATA flow
- map HTTP/2 stream end/reset/failure semantics sensibly to WebSocket close behavior
Motivation
Modern browsers support WebSockets over HTTP/2 via RFC 8441. Supporting this in Pekko HTTP would allow one server port and one HTTP/2 connection to handle both normal HTTP traffic and WebSockets.
This is useful for frameworks built on Pekko HTTP as well. For example, Play Framework can enable HTTP/2 on its Pekko HTTP backend, but WebSocket support still depends on the HTTP/1.1 upgrade path because Pekko HTTP does not currently expose RFC 8441 WebSocket support.
Notes
Netty has already added several low-level RFC 8441 building blocks, but still tracks high-level WebSocket-over-HTTP/2 support as an open feature request:
- https://github.com/netty/netty/issues/8011
- https://github.com/netty/netty/issues/12352
- https://github.com/netty/netty/pull/11192
- https://github.com/netty/netty/pull/14995
- https://github.com/netty/netty/pull/15312
- https://github.com/netty/netty/pull/16932
A third-party Netty implementation also exists:
Questions
- Would the Pekko HTTP project be open to RFC 8441 server-side support?
- Should this be implemented behind an explicit config flag, for example under
pekko.http.server.websocketorpekko.http.server.http2? - Should the existing
WebSocketUpgradeAPI be reused for HTTP/2 Extended CONNECT, or should there be a separate API to distinguish HTTP/1.1 upgrade from HTTP/2 stream-based WebSocket bootstrap?
- Lenguaje dominante
- Scala
- Estrellas
- 196
- Forks
- 56
- Merge medio
- 1 d 18 h
- PR fusionados (30 d)
- 43
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/pekko-http
-
dependencies
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
apache/pekko-http#1354 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
apache/pekko-http#1273 ·
Los mantenedores suelen responder en 1 día
-
HTTP/2 client ALPN fallback needs a handshake-complete signal that the TLS stage does not emitAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
apache/pekko-http#1249 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
apache/pekko-http#1248 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
apache/pekko-http#1180 ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/pekko-http
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
scalameta/metals-zed#99 ·
-
Bound wrong-magic P2P diagnostics to parsed header bytesPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
ergoplatform/ergo#2736 ·
Los mantenedores suelen responder en 1 día
-
perf: use extend when buffering partition row indices in the native shuffle writerPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoarea:shuffle enhancement good first issue performance requires-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/datafusion-comet#7072 ·
Los mantenedores suelen responder en 1 día
-
bug 🐞 CI/CD ⚒️
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
valkey-io/valkey-glide#7370 ·
Los mantenedores suelen responder en 1 día
-
Improve UI text on confirmation page (at registration)Posiblemente ocupada @Arghyann la tomó hace 1 día. Abiertogood first issue improvement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
lichess-org/lila#22126 · 2 comentarios ·
Los mantenedores suelen responder en 1 día