public class WebMvcStompWebSocketEndpointRegistration extends Object implements StompWebSocketEndpointRegistration
Constructor and Description |
---|
WebMvcStompWebSocketEndpointRegistration(String[] paths,
WebSocketHandler webSocketHandler,
TaskScheduler sockJsTaskScheduler) |
Modifier and Type | Method and Description |
---|---|
StompWebSocketEndpointRegistration |
addInterceptors(HandshakeInterceptor... interceptors)
Configure the HandshakeInterceptor's to use.
|
protected HandshakeInterceptor[] |
getInterceptors() |
MultiValueMap<HttpRequestHandler,String> |
getMappings() |
StompWebSocketEndpointRegistration |
setAllowedOriginPatterns(String... allowedOriginPatterns)
Alternative to
StompWebSocketEndpointRegistration.setAllowedOrigins(String...) that supports more
flexible patterns for specifying the origins for which cross-origin
requests are allowed from a browser. |
StompWebSocketEndpointRegistration |
setAllowedOrigins(String... allowedOrigins)
Set the origins for which cross-origin requests are allowed from a browser.
|
StompWebSocketEndpointRegistration |
setHandshakeHandler(HandshakeHandler handshakeHandler)
Configure the HandshakeHandler to use.
|
SockJsServiceRegistration |
withSockJS()
Enable SockJS fallback options.
|
public WebMvcStompWebSocketEndpointRegistration(String[] paths, WebSocketHandler webSocketHandler, TaskScheduler sockJsTaskScheduler)
public StompWebSocketEndpointRegistration setHandshakeHandler(HandshakeHandler handshakeHandler)
StompWebSocketEndpointRegistration
setHandshakeHandler
in interface StompWebSocketEndpointRegistration
public StompWebSocketEndpointRegistration addInterceptors(HandshakeInterceptor... interceptors)
StompWebSocketEndpointRegistration
addInterceptors
in interface StompWebSocketEndpointRegistration
public StompWebSocketEndpointRegistration setAllowedOrigins(String... allowedOrigins)
StompWebSocketEndpointRegistration
CorsConfiguration.setAllowedOrigins(List)
for
format details and considerations, and keep in mind that the CORS spec
does not allow use of "*"
with allowCredentials=true
.
For more flexible origin patterns use StompWebSocketEndpointRegistration.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.
public StompWebSocketEndpointRegistration setAllowedOriginPatterns(String... allowedOriginPatterns)
StompWebSocketEndpointRegistration
StompWebSocketEndpointRegistration.setAllowedOrigins(String...)
that supports more
flexible patterns for specifying the origins for which cross-origin
requests are allowed from a browser. Please, refer to
CorsConfiguration.setAllowedOriginPatterns(List)
for format
details and other considerations.
By default this is not set.
setAllowedOriginPatterns
in interface StompWebSocketEndpointRegistration
public SockJsServiceRegistration withSockJS()
StompWebSocketEndpointRegistration
withSockJS
in interface StompWebSocketEndpointRegistration
protected HandshakeInterceptor[] getInterceptors()
public final MultiValueMap<HttpRequestHandler,String> getMappings()