open class SockJsClient : WebSocketClient, Lifecycle
A SockJS implementation of org.springframework.web.socket.client.WebSocketClient with fallback alternatives that simulate a WebSocket interaction through plain HTTP streaming and long polling techniques..
Implements Lifecycle in order to propagate lifecycle events to the transports it is configured with.
Author
Rossen Stoyanchev
Since
4.1
See Also
<a href="http://sockjs.org">http://sockjs.org</a>org.springframework.web.socket.sockjs.client.Transport
SockJsClient(transports: MutableList<Transport>)
Create a If the list includes an XhrTransport (or more specifically an implementation of InfoReceiver) the instance is used to initialize the |
open fun clearServerInfoCache(): Unit
By default the result of a SockJS "Info" request, including whether the server has WebSocket disabled and how long the request took (used for calculating transport timeout time) is cached. This method can be used to clear that cache hence causing it to re-populate. |
|
open fun doHandshake(handler: WebSocketHandler, uriTemplate: String, vararg uriVars: Any): ListenableFuture<WebSocketSession>fun doHandshake(handler: WebSocketHandler, headers: WebSocketHttpHeaders, url: URI): ListenableFuture<WebSocketSession> |
|
open fun getHttpHeaderNames(): Array<String>
The configured HTTP header names to be copied from the handshake headers and also included in other HTTP requests. |
|
open fun getInfoReceiver(): InfoReceiver
Return the configured |
|
open fun getMessageCodec(): SockJsMessageCodec
Return the SockJsMessageCodec to use. |
|
open fun isRunning(): Boolean |
|
open fun setConnectTimeoutScheduler(connectTimeoutScheduler: TaskScheduler): Unit
Configure a By default this is not configured in which case a fallback may take longer. |
|
open fun setHttpHeaderNames(vararg httpHeaderNames: String): Unit
The names of HTTP headers that should be copied from the handshake headers of each call to By default if this property is not set, all handshake headers are also used for other HTTP requests. Set it if you want only a subset of handshake headers (e.g. auth headers) to be used for other HTTP requests. |
|
open fun setInfoReceiver(infoReceiver: InfoReceiver): Unit
Configure the If the list of transports provided to the constructor contained an XhrTransport or an implementation of InfoReceiver that instance would have been used to initialize this property, or otherwise it defaults to RestTemplateXhrTransport. |
|
open fun setMessageCodec(messageCodec: SockJsMessageCodec): Unit
Set the SockJsMessageCodec to use. By default org.springframework.web.socket.sockjs.frame.Jackson2SockJsMessageCodec is used if Jackson is on the classpath. |
|
open fun start(): Unit |
|
open fun stop(): Unit |