Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow connect on Http2ProtocolOptions when Websockets are enabled #6846

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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 {
cm.Http2ProtocolOptions = http2Options
}

return &envoy_config_listener_v3.Filter{
Expand Down
Loading