Interface WebSocketHandlerRegistration
- All Known Implementing Classes:
- AbstractWebSocketHandlerRegistration,- ServletWebSocketHandlerRegistration
public interface WebSocketHandlerRegistration
Provides methods for configuring a WebSocket handler.
- Since:
- 4.0
- Author:
- Rossen Stoyanchev
- 
Method SummaryModifier and TypeMethodDescriptionaddHandler(WebSocketHandler handler, String... paths) Add more handlers that will share the same configuration (interceptors, SockJS config, etc).addInterceptors(HandshakeInterceptor... interceptors) Configure interceptors for the handshake request.setAllowedOriginPatterns(String... originPatterns) Alternative tosetAllowedOrigins(String...)that supports more flexible patterns for specifying the origins for which cross-origin requests are allowed from a browser.setAllowedOrigins(String... origins) 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.
- 
Method Details- 
addHandlerAdd more handlers that will share the same configuration (interceptors, SockJS config, etc).
- 
setHandshakeHandlerConfigure the HandshakeHandler to use.
- 
addInterceptorsConfigure interceptors for the handshake request.
- 
setAllowedOriginsSet 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 usesetAllowedOriginPatterns(java.lang.String...)instead.By default, no origins are allowed. When allowedOriginPatternsis 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. 
- 
setAllowedOriginPatternsAlternative tosetAllowedOrigins(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. - Since:
- 5.3.5
 
- 
withSockJSSockJsServiceRegistration withSockJS()Enable SockJS fallback options.
 
-