spring-framework / org.springframework.web.socket.client / WebSocketConnectionManager

WebSocketConnectionManager

open class WebSocketConnectionManager : ConnectionManagerSupport

A WebSocket connection manager that is given a URI, a WebSocketClient, and a WebSocketHandler, connects to a WebSocket server through #start() and #stop() methods. If #setAutoStartup(boolean) is set to true this will be done automatically when the Spring ApplicationContext is refreshed.

Author
Rossen Stoyanchev

Since
4.0

Constructors

<init>

WebSocketConnectionManager(client: WebSocketClient, webSocketHandler: WebSocketHandler, uriTemplate: String, vararg uriVariables: Any)

Functions

getHeaders

open fun getHeaders(): HttpHeaders

Return the default headers for the WebSocket handshake request.

getOrigin

open fun getOrigin(): String

Return the configured origin.

getSubProtocols

open fun getSubProtocols(): MutableList<String>

Return the configured sub-protocols to use.

setHeaders

open fun setHeaders(headers: HttpHeaders): Unit

Provide default headers to add to the WebSocket handshake request.

setOrigin

open fun setOrigin(origin: String): Unit

Set the origin to use.

setSubProtocols

open fun setSubProtocols(protocols: MutableList<String>): Unit

Set the sub-protocols to use. If configured, specified sub-protocols will be requested in the handshake through the Sec-WebSocket-Protocol header. The resulting WebSocket session will contain the protocol accepted by the server, if any.

startInternal

open fun startInternal(): Unit

stopInternal

open fun stopInternal(): Unit