类 WebMvcStompWebSocketEndpointRegistration
- java.lang.Object
- org.springframework.web.socket.config.annotation.WebMvcStompWebSocketEndpointRegistration
- 所有已实现的接口:
StompWebSocketEndpointRegistration
public class WebMvcStompWebSocketEndpointRegistration extends Object implements StompWebSocketEndpointRegistration
An abstract base class for configuring STOMP over WebSocket/SockJS endpoints.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 WebMvcStompWebSocketEndpointRegistration(String[] paths, WebSocketHandler webSocketHandler, TaskScheduler sockJsTaskScheduler)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 StompWebSocketEndpointRegistration
addInterceptors(HandshakeInterceptor... interceptors)
Configure the HandshakeInterceptor's to use.protected HandshakeInterceptor[]
getInterceptors()
MultiValueMap<HttpRequestHandler,String>
getMappings()
StompWebSocketEndpointRegistration
setAllowedOrigins(String... allowedOrigins)
Configure allowedOrigin
header values.StompWebSocketEndpointRegistration
setHandshakeHandler(HandshakeHandler handshakeHandler)
Configure the HandshakeHandler to use.SockJsServiceRegistration
withSockJS()
Enable SockJS fallback options.
构造器详细资料
WebMvcStompWebSocketEndpointRegistration
public WebMvcStompWebSocketEndpointRegistration(String[] paths, WebSocketHandler webSocketHandler, TaskScheduler sockJsTaskScheduler)
方法详细资料
setHandshakeHandler
public StompWebSocketEndpointRegistration setHandshakeHandler(HandshakeHandler handshakeHandler)
从接口复制的说明:StompWebSocketEndpointRegistration
Configure the HandshakeHandler to use.
addInterceptors
public StompWebSocketEndpointRegistration addInterceptors(HandshakeInterceptor... interceptors)
从接口复制的说明:StompWebSocketEndpointRegistration
Configure the HandshakeInterceptor's to use.
setAllowedOrigins
public StompWebSocketEndpointRegistration setAllowedOrigins(String... allowedOrigins)
从接口复制的说明:StompWebSocketEndpointRegistration
Configure allowedOrigin
header values. This check is mostly designed for browser clients. There is nothing preventing other types of client to modify theOrigin
header value.When SockJS is enabled and origins are restricted, transport types that do not allow to check request origin (JSONP and 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).
withSockJS
public SockJsServiceRegistration withSockJS()
从接口复制的说明:StompWebSocketEndpointRegistration
Enable SockJS fallback options.
getInterceptors
protected HandshakeInterceptor[] getInterceptors()
getMappings
public final MultiValueMap<HttpRequestHandler,String> getMappings()