public interface WebSocketHandlerRegistration
Modifier and Type | Method and Description |
---|---|
WebSocketHandlerRegistration |
addHandler(WebSocketHandler handler,
String... paths)
Add more handlers that will share the same configuration (interceptors, SockJS
config, etc).
|
WebSocketHandlerRegistration |
addInterceptors(HandshakeInterceptor... interceptors)
Configure interceptors for the handshake request.
|
WebSocketHandlerRegistration |
setAllowedOriginPatterns(String... originPatterns)
A variant of
setAllowedOrigins(String...) that accepts flexible
domain patterns, e.g. |
WebSocketHandlerRegistration |
setAllowedOrigins(String... origins)
Configure allowed
Origin header values. |
WebSocketHandlerRegistration |
setHandshakeHandler(HandshakeHandler handshakeHandler)
Configure the HandshakeHandler to use.
|
SockJsServiceRegistration |
withSockJS()
Enable SockJS fallback options.
|
WebSocketHandlerRegistration addHandler(WebSocketHandler handler, String... paths)
WebSocketHandlerRegistration setHandshakeHandler(HandshakeHandler handshakeHandler)
WebSocketHandlerRegistration addInterceptors(HandshakeInterceptor... interceptors)
WebSocketHandlerRegistration setAllowedOrigins(String... origins)
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).
WebSocketHandlerRegistration setAllowedOriginPatterns(String... originPatterns)
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.SockJsServiceRegistration withSockJS()