org.springframework.web.socket.config.annotation.EnableWebSocket and
WebSocketConfigurer setup.
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private final List | |
| private String | |
| private Long | |
| private Long | |
| private Integer | |
| private final List | |
| private SockJsMessageCodec | |
| private TaskScheduler | |
| private Boolean | |
| private Integer | |
| private Boolean | |
| private final List | |
| private final List | |
| private Boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private TransportHandlingSockJsService | |
| protected SockJsService | |
| protected TaskScheduler | |
| protected SockJsServiceRegistration | setAllowedOriginPatterns(String... allowedOriginPatterns)
Configure allowed |
| protected SockJsServiceRegistration | |
| public SockJsServiceRegistration | setClientLibraryUrl(String clientLibraryUrl)
Transports with no native cross-domain communication (e.g. "eventsource",
"htmlfile") must get a simple page from the "foreign" domain in an invisible
|
| public SockJsServiceRegistration | setDisconnectDelay(long disconnectDelay)
The amount of time in milliseconds before a client is considered disconnected after not having a receiving connection, i.e. an active connection over which the server can send data to the client. |
| public SockJsServiceRegistration | setHeartbeatTime(long heartbeatTime)
The amount of time in milliseconds when the server has not sent any messages and after which the server should send a heartbeat frame to the client in order to keep the connection from breaking. |
| public SockJsServiceRegistration | setHttpMessageCacheSize(int httpMessageCacheSize)
The number of server-to-client messages that a session can cache while waiting for the next HTTP polling request from the client. |
| public SockJsServiceRegistration | |
| public SockJsServiceRegistration | setMessageCodec(SockJsMessageCodec
the codec to use. codec)The codec to use for encoding and decoding SockJS messages. |
| public SockJsServiceRegistration | setSessionCookieNeeded(boolean sessionCookieNeeded)
The SockJS protocol requires a server to respond to the initial "/info" request from clients with a "cookie_needed" boolean property that indicates whether the use of a JSESSIONID cookie is required for the application to function correctly, e.g. for load balancing or in Java Servlet containers for the use of an HTTP session. |
| public SockJsServiceRegistration | setStreamBytesLimit(int streamBytesLimit)
Streaming transports save responses on the client side and don't free memory used by delivered messages. |
| public SockJsServiceRegistration | setSuppressCors(boolean suppressCors)
This option can be used to disable automatic addition of CORS headers for SockJS requests. |
| public SockJsServiceRegistration | setTaskScheduler(TaskScheduler scheduler)
A scheduler instance to use for scheduling SockJS heart-beats. |
| public SockJsServiceRegistration | |
| public SockJsServiceRegistration | |
| public SockJsServiceRegistration |
| allowedOriginPatterns | back to summary |
|---|---|
| private final List<String> allowedOriginPatterns | |
| allowedOrigins | back to summary |
|---|---|
| private final List<String> allowedOrigins | |
| clientLibraryUrl | back to summary |
|---|---|
| private String clientLibraryUrl
| |
| disconnectDelay | back to summary |
|---|---|
| private Long disconnectDelay
| |
| heartbeatTime | back to summary |
|---|---|
| private Long heartbeatTime
| |
| httpMessageCacheSize | back to summary |
|---|---|
| private Integer httpMessageCacheSize
| |
| interceptors | back to summary |
|---|---|
| private final List<HandshakeInterceptor> interceptors | |
| messageCodec | back to summary |
|---|---|
| private SockJsMessageCodec messageCodec
| |
| scheduler | back to summary |
|---|---|
| private TaskScheduler scheduler
| |
| sessionCookieNeeded | back to summary |
|---|---|
| private Boolean sessionCookieNeeded
| |
| streamBytesLimit | back to summary |
|---|---|
| private Integer streamBytesLimit
| |
| suppressCors | back to summary |
|---|---|
| private Boolean suppressCors
| |
| transportHandlerOverrides | back to summary |
|---|---|
| private final List<TransportHandler> transportHandlerOverrides | |
| transportHandlers | back to summary |
|---|---|
| private final List<TransportHandler> transportHandlers | |
| webSocketEnabled | back to summary |
|---|---|
| private Boolean webSocketEnabled
| |
| SockJsServiceRegistration | back to summary |
|---|---|
| public SockJsServiceRegistration() | |
| createSockJsService | back to summary |
|---|---|
| private TransportHandlingSockJsService createSockJsService() | |
| getSockJsService | back to summary |
|---|---|
| protected SockJsService getSockJsService() | |
| getTaskScheduler | back to summary |
|---|---|
| protected TaskScheduler getTaskScheduler() Return the TaskScheduler, if configured.
| |
| setAllowedOriginPatterns | back to summary |
|---|---|
| protected SockJsServiceRegistration setAllowedOriginPatterns(String... allowedOriginPatterns) Configure allowed
| |
| setAllowedOrigins | back to summary |
|---|---|
| protected SockJsServiceRegistration setAllowedOrigins(String... allowedOrigins) Configure allowed
| |
| setClientLibraryUrl | back to summary |
|---|---|
| public SockJsServiceRegistration setClientLibraryUrl(String clientLibraryUrl) Transports with no native cross-domain communication (e.g. "eventsource",
"htmlfile") must get a simple page from the "foreign" domain in an invisible
By default this is set to point to "https://cdn.jsdelivr.net/sockjs/1.0.0/sockjs.min.js". However, it can also be set to point to a URL served by the application. Note that it's possible to specify a relative URL in which case the URL
must be relative to the | |
| setDisconnectDelay | back to summary |
|---|---|
| public SockJsServiceRegistration setDisconnectDelay(long disconnectDelay) The amount of time in milliseconds before a client is considered disconnected after not having a receiving connection, i.e. an active connection over which the server can send data to the client. The default value is 5000. | |
| setHeartbeatTime | back to summary |
|---|---|
| public SockJsServiceRegistration setHeartbeatTime(long heartbeatTime) The amount of time in milliseconds when the server has not sent any messages and after which the server should send a heartbeat frame to the client in order to keep the connection from breaking. The default value is 25,000 (25 seconds). | |
| setHttpMessageCacheSize | back to summary |
|---|---|
| public SockJsServiceRegistration setHttpMessageCacheSize(int httpMessageCacheSize) The number of server-to-client messages that a session can cache while waiting for the next HTTP polling request from the client. All HTTP transports use this property since even streaming transports recycle HTTP requests periodically. The amount of time between HTTP requests should be relatively brief and will not
exceed the allows disconnect delay (see
The default size is 100. | |
| setInterceptors | back to summary |
|---|---|
| public SockJsServiceRegistration setInterceptors(HandshakeInterceptor... interceptors) | |
| setMessageCodec | back to summary |
|---|---|
| public SockJsServiceRegistration setMessageCodec(SockJsMessageCodec codec) The codec to use for encoding and decoding SockJS messages. By default
| |
| setSessionCookieNeeded | back to summary |
|---|---|
| public SockJsServiceRegistration setSessionCookieNeeded(boolean sessionCookieNeeded) The SockJS protocol requires a server to respond to the initial "/info" request from clients with a "cookie_needed" boolean property that indicates whether the use of a JSESSIONID cookie is required for the application to function correctly, e.g. for load balancing or in Java Servlet containers for the use of an HTTP session. This is especially important for IE 8,9 that support XDomainRequest -- a modified AJAX/XHR -- that can do requests across domains but does not send any cookies. In those cases, the SockJS client prefers the "iframe-htmlfile" transport over "xdr-streaming" in order to be able to send cookies. The default value is "true" to maximize the chance for applications to work correctly in IE 8,9 with support for cookies (and the JSESSIONID cookie in particular). However, an application can choose to set this to "false" if the use of cookies (and HTTP session) is not required. | |
| setStreamBytesLimit | back to summary |
|---|---|
| public SockJsServiceRegistration setStreamBytesLimit(int streamBytesLimit) Streaming transports save responses on the client side and don't free memory used by delivered messages. Such transports need to recycle the connection once in a while. This property sets a minimum number of bytes that can be sent over a single HTTP streaming request before it will be closed. After that client will open a new request. Setting this value to one effectively disables streaming and will make streaming transports to behave like polling transports. The default value is 128K (i.e. 128 * 1024). | |
| setSuppressCors | back to summary |
|---|---|
| public SockJsServiceRegistration setSuppressCors(boolean suppressCors) This option can be used to disable automatic addition of CORS headers for SockJS requests. The default value is "false".
| |
| setTaskScheduler | back to summary |
|---|---|
| public SockJsServiceRegistration setTaskScheduler(TaskScheduler scheduler) A scheduler instance to use for scheduling SockJS heart-beats. | |
| setTransportHandlerOverrides | back to summary |
|---|---|
| public SockJsServiceRegistration setTransportHandlerOverrides(TransportHandler... handlers) | |
| setTransportHandlers | back to summary |
|---|---|
| public SockJsServiceRegistration setTransportHandlers(TransportHandler... handlers) | |
| setWebSocketEnabled | back to summary |
|---|---|
| public SockJsServiceRegistration setWebSocketEnabled(boolean webSocketEnabled) Some load balancers don't support WebSocket. This option can be used to disable the WebSocket transport on the server side. The default value is "true". | |