Groovy Documentation

## org.vertx.groovy.core.http
[Groovy] Class ServerWebSocket

    java.lang.Object
      org.vertx.groovy.core.http.WebSocket
          org.vertx.groovy.core.http.ServerWebSocket

    class ServerWebSocket
    extends WebSocket

Represents a server side WebSocket that is passed into a the websocketHandler of an HttpServer

Instances of this class are not thread-safe

Authors:
  Tim Fox

Constructor Summary
`protected ServerWebSocket(JServerWebSocket jSWS)`

Method Summary
`java.lang.String` | `getPath()` @return The path the websocket is attempting to connect at
`void` | `reject()` Reject the WebSocket

Methods inherited from class WebSocket
close, closedHandler, dataHandler, drainHandler, endHandler, exceptionHandler, getBinaryHandlerID, getTextHandlerID, isWriteQueueFull, leftShift, leftShift, pause, resume, setWriteQueueMaxSize, writeBinaryFrame, writeBuffer, writeTextFrame

Constructor Detail

### ServerWebSocket

    protected ServerWebSocket(JServerWebSocket jSWS)

Method Detail

### getPath

    java.lang.String getPath()

  Returns:
    The path the websocket is attempting to connect at

### reject

    void reject()

  Reject the WebSocket

  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.

Groovy Documentation