Skip to content

Mvc websockets - #4324

Merged
spencergibb merged 4 commits into
spring-cloud:mainfrom
spencergibb:mvc-websockets
Oct 15, 2026
Merged

spencergibb merged 4 commits into
spring-cloud:mainfrom
spencergibb:mvc-websockets

Conversation

@spencergibb

Copy link
Copy Markdown
Member

Fixes #3442

spencergibb and others added 3 commits October 9, 2026 19:01
Routes with ws/wss URIs, or http routes receiving an Upgrade:
websocket request, are now proxied as WebSockets when
spring-boot-starter-websocket is on the classpath.

Cross-origin handshakes are rejected by default; configure
spring.cloud.gateway.server.webmvc.websocket.allowed-origins to
allow other origins.

Fixes spring-cloudgh-3442

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pongs are now relayed in both directions. Pings cannot be relayed:
the servlet WebSocket API never delivers them, and the container
answers them itself, which the docs now explain.

Adds unit tests for WebSocketProxyBridge and integration tests for
lb:// routes, after-filter headers on the handshake response, and
ping/pong handling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
allowedOrigins now maps to exact origins and the new
allowedOriginPatterns to wildcard patterns on the origin interceptor.
@spencergibb
spencergibb merged commit 82135c2 into spring-cloud:main Oct 15, 2026
2 checks passed
@spencergibb
spencergibb deleted the mvc-websockets branch October 15, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Websockets in gateway server webmvc

1 participant