public interface ServerWebSocket extends WebSocketBase<ServerWebSocket>
HttpServer
Instances of this class are not thread-safe
Modifier and Type | Method and Description |
---|---|
MultiMap |
headers()
A map of all headers in the request to upgrade to websocket
|
java.lang.String |
path()
The path the websocket is attempting to connect at
|
java.lang.String |
query()
The query string passed on the websocket uri
|
ServerWebSocket |
reject()
Reject the WebSocket
|
java.lang.String |
uri() |
binaryHandlerID, close, closeHandler, frameHandler, localAddress, remoteAddress, textHandlerID, writeBinaryFrame, writeTextFrame
endHandler
dataHandler, pause, resume
exceptionHandler
write
drainHandler, setWriteQueueMaxSize, writeQueueFull
java.lang.String uri()
java.lang.String path()
java.lang.String query()
MultiMap headers()
ServerWebSocket reject()
Calling this method from the websocketHandler gives you the opportunity to reject the websocket, which will cause the websocket handshake to fail by returning a 404 response code.
You might use this method, if for example you only want to accept websockets with a particular path.