Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelogs/unreleased/6846-rajatvig-small.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Set `allow_connect` to true on `Http2ProtocolOptions` on the Listener when websockets are enabled.
12 changes: 9 additions & 3 deletions internal/envoy/v3/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,10 +556,10 @@ func (b *httpConnectionManagerBuilder) Get() *envoy_config_listener_v3.Filter {
cm.CommonHttpProtocolOptions.MaxRequestsPerConnection = wrapperspb.UInt32(*b.maxRequestsPerConnection)
}

http2Options := &envoy_config_core_v3.Http2ProtocolOptions{}

if b.http2MaxConcurrentStreams != nil {
cm.Http2ProtocolOptions = &envoy_config_core_v3.Http2ProtocolOptions{
MaxConcurrentStreams: wrapperspb.UInt32(*b.http2MaxConcurrentStreams),
}
http2Options.MaxConcurrentStreams = wrapperspb.UInt32(*b.http2MaxConcurrentStreams)
}

if b.enableWebsockets {
Expand All @@ -568,6 +568,12 @@ func (b *httpConnectionManagerBuilder) Get() *envoy_config_listener_v3.Filter {
UpgradeType: "websocket",
},
)
http2Options.AllowConnect = true
}

// Assign http2Options only if it has been modified
if b.http2MaxConcurrentStreams != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont think this is quite right? if max concurrent streams is not set, but websockets are enabled we would still want to set the http2 options

cm.Http2ProtocolOptions = http2Options
}

return &envoy_config_listener_v3.Filter{
Expand Down
Loading