public interface ServerWebSocket extends WebSocketBase<ServerWebSocket>
HttpServerInstances 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
|
ServerWebSocket |
reject()
Reject the WebSocket
|
binaryHandlerID, close, closeHandler, textHandlerID, writeBinaryFrame, writeTextFramedataHandler, endHandler, pause, resumedrainHandler, setWriteQueueMaxSize, write, writeQueueFullexceptionHandlerjava.lang.String path()
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.