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)
A variant of
StompWebSocketEndpointRegistration.setAllowedOrigins(String...) that accepts flexible
domain patterns, e.g. |
StompWebSocketEndpointRegistration |
setAllowedOrigins(String... allowedOrigins)
Configure allowed
Origin header values. |
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
Origin
header values. This check is mostly designed for
browser clients. There is nothing preventing other types of client to modify the
Origin
header value.
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.
Each provided allowed origin must start by "http://", "https://" or be "*" (means that all origins are allowed). By default, only same origin requests are allowed (empty list).
setAllowedOrigins
in interface StompWebSocketEndpointRegistration
public StompWebSocketEndpointRegistration setAllowedOriginPatterns(String... allowedOriginPatterns)
StompWebSocketEndpointRegistration
StompWebSocketEndpointRegistration.setAllowedOrigins(String...)
that accepts flexible
domain patterns, e.g. "https://*.domain1.com"
. Furthermore it
always sets the Access-Control-Allow-Origin
response header to
the matched origin and never to "*"
, nor to any other pattern.setAllowedOriginPatterns
in interface StompWebSocketEndpointRegistration
public SockJsServiceRegistration withSockJS()
StompWebSocketEndpointRegistration
withSockJS
in interface StompWebSocketEndpointRegistration
protected HandshakeInterceptor[] getInterceptors()
public final MultiValueMap<HttpRequestHandler,String> getMappings()