Class WebMvcStompWebSocketEndpointRegistration
java.lang.Object
org.springframework.web.socket.config.annotation.WebMvcStompWebSocketEndpointRegistration
- All Implemented Interfaces:
StompWebSocketEndpointRegistration
public class WebMvcStompWebSocketEndpointRegistration
extends Object
implements StompWebSocketEndpointRegistration
An abstract base class for configuring STOMP over WebSocket/SockJS endpoints.
- Since:
- 4.0
- Author:
- Rossen Stoyanchev
-
Constructor Summary
ConstructorDescriptionWebMvcStompWebSocketEndpointRegistration
(String[] paths, WebSocketHandler webSocketHandler, TaskScheduler sockJsTaskScheduler) -
Method Summary
Modifier and TypeMethodDescriptionaddInterceptors
(HandshakeInterceptor... interceptors) Configure the HandshakeInterceptor's to use.protected HandshakeInterceptor[]
setAllowedOriginPatterns
(String... allowedOriginPatterns) Alternative toStompWebSocketEndpointRegistration.setAllowedOrigins(String...)
that supports more flexible patterns for specifying the origins for which cross-origin requests are allowed from a browser.setAllowedOrigins
(String... allowedOrigins) Set the origins for which cross-origin requests are allowed from a browser.setHandshakeHandler
(HandshakeHandler handshakeHandler) Configure the HandshakeHandler to use.Enable SockJS fallback options.
-
Constructor Details
-
WebMvcStompWebSocketEndpointRegistration
public WebMvcStompWebSocketEndpointRegistration(String[] paths, WebSocketHandler webSocketHandler, TaskScheduler sockJsTaskScheduler)
-
-
Method Details
-
setHandshakeHandler
Description copied from interface:StompWebSocketEndpointRegistration
Configure the HandshakeHandler to use.- Specified by:
setHandshakeHandler
in interfaceStompWebSocketEndpointRegistration
-
addInterceptors
Description copied from interface:StompWebSocketEndpointRegistration
Configure the HandshakeInterceptor's to use.- Specified by:
addInterceptors
in interfaceStompWebSocketEndpointRegistration
-
setAllowedOrigins
Description copied from interface:StompWebSocketEndpointRegistration
Set the origins for which cross-origin requests are allowed from a browser. Please, refer toCorsConfiguration.setAllowedOrigins(List)
for format details and considerations, and keep in mind that the CORS spec does not allow use of"*"
withallowCredentials=true
. For more flexible origin patterns useStompWebSocketEndpointRegistration.setAllowedOriginPatterns(java.lang.String...)
instead.By default, no origins are allowed. When
allowedOriginPatterns
is also set, then that takes precedence over this property.Note when SockJS is enabled and origins are restricted, transport types that do not allow to check request origin (Iframe based transports) are disabled. As a consequence, IE 6 to 9 are not supported when origins are restricted.
-
setAllowedOriginPatterns
Description copied from interface:StompWebSocketEndpointRegistration
Alternative toStompWebSocketEndpointRegistration.setAllowedOrigins(String...)
that supports more flexible patterns for specifying the origins for which cross-origin requests are allowed from a browser. Please, refer toCorsConfiguration.setAllowedOriginPatterns(List)
for format details and other considerations.By default this is not set.
- Specified by:
setAllowedOriginPatterns
in interfaceStompWebSocketEndpointRegistration
-
withSockJS
Description copied from interface:StompWebSocketEndpointRegistration
Enable SockJS fallback options.- Specified by:
withSockJS
in interfaceStompWebSocketEndpointRegistration
-
getInterceptors
-
getMappings
-