Skip to content

WebSocket mode allows HTTP/2 connections too

Mikhail Mazurskiy requested to merge ash2k/better-ws-wrapper into master

This MR changes kas to allow both HTTP/2 connections AND WebSocket connections on the agent port at the same time (when in WebSocket mode).

To determine if it's a HTTP/1.1 or HTTP/2 (i.e. gRPC) connection, kas:

  • When configured in TLS mode, looks at the protocol, negotiated via ALPN.
  • When configured in cleartext mode, reads the first few bytes from the connection and looks for HTTP/2 client preface.

This should make it possible to transition to gRPC from WebSocket without breaking anyone by supporting both connection protocols on the same port at the same time.

Relates to gitlab-org/gitlab#365945 (closed).

Relates to gitlab-com/gl-infra/delivery#2457 (closed).

Relates to gitlab-org/gitlab#346248 (closed).

Merge request reports

Loading