spring-framework / org.springframework.web.reactive.socket.server.support / HandshakeWebSocketService

HandshakeWebSocketService

open class HandshakeWebSocketService : WebSocketService, Lifecycle

WebSocketService implementation that handles a WebSocket HTTP handshake request by delegating to a RequestUpgradeStrategy which is either auto-detected (no-arg constructor) from the classpath but can also be explicitly configured.

Author
Rossen Stoyanchev

Since
5.0

Constructors

<init>

HandshakeWebSocketService()

Default constructor automatic, classpath detection based discovery of the RequestUpgradeStrategy to use.

HandshakeWebSocketService(upgradeStrategy: RequestUpgradeStrategy)

Alternative constructor with the RequestUpgradeStrategy to use.

Functions

getUpgradeStrategy

open fun getUpgradeStrategy(): RequestUpgradeStrategy

Return the RequestUpgradeStrategy for WebSocket requests.

handleRequest

open fun handleRequest(exchange: ServerWebExchange, handler: WebSocketHandler): Mono<Void>

isRunning

open fun isRunning(): Boolean

start

open fun start(): Unit

stop

open fun stop(): Unit