From 3f86eb0f066a12de8601da9ac84d422bb88b8920 Mon Sep 17 00:00:00 2001 From: Hein Date: Tue, 30 Jun 2026 13:36:06 +0200 Subject: [PATCH] feat(config): add HTTP2 field to ServerInstanceConfig and align with server.Config --- pkg/config/config.go | 4 ++++ pkg/server/config_helper.go | 1 + 2 files changed, 5 insertions(+) diff --git a/pkg/config/config.go b/pkg/config/config.go index b6265bf..c1d5905 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -50,6 +50,10 @@ type ServerInstanceConfig struct { // GZIP enables GZIP compression middleware GZIP bool `mapstructure:"gzip"` + // HTTP2 enables HTTP/2 with the Extended CONNECT protocol (RFC 8441) for WebSocket support. + // Requires TLS; pair with SSLCert/SSLKey, SelfSignedSSL, or AutoTLS. + HTTP2 bool `mapstructure:"http2"` + // TLS/HTTPS configuration options (mutually exclusive) // Option 1: Provide certificate and key files directly SSLCert string `mapstructure:"ssl_cert"` diff --git a/pkg/server/config_helper.go b/pkg/server/config_helper.go index cf42688..c2305fb 100644 --- a/pkg/server/config_helper.go +++ b/pkg/server/config_helper.go @@ -16,6 +16,7 @@ func FromConfigInstanceToServerConfig(sic *config.ServerInstanceConfig, handler Description: sic.Description, Handler: handler, GZIP: sic.GZIP, + HTTP2: sic.HTTP2, SSLCert: sic.SSLCert, SSLKey: sic.SSLKey,