Class WebSocketClientHandshaker00

java.lang.Object
io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker
io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker00

public class WebSocketClientHandshaker00 extends WebSocketClientHandshaker

Performs client side opening and closing handshakes for web socket specification version draft-ietf-hybi-thewebsocketprotocol- 00

A very large portion of this code was taken from the Netty 3.2 HTTP example.

  • Field Details

    • expectedChallengeResponseBytes

      private ByteBuf expectedChallengeResponseBytes
  • Constructor Details

    • WebSocketClientHandshaker00

      public WebSocketClientHandshaker00(URI webSocketURL, WebSocketVersion version, String subprotocol, HttpHeaders customHeaders, int maxFramePayloadLength)
      Creates a new instance with the specified destination WebSocket location and version to initiate.
      Parameters:
      webSocketURL - URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
      version - Version of web socket specification to use to connect to the server
      subprotocol - Sub protocol request sent to the server.
      customHeaders - Map of custom headers to add to the client request
      maxFramePayloadLength - Maximum length of a frame's payload
    • WebSocketClientHandshaker00

      public WebSocketClientHandshaker00(URI webSocketURL, WebSocketVersion version, String subprotocol, HttpHeaders customHeaders, int maxFramePayloadLength, long forceCloseTimeoutMillis)
      Creates a new instance with the specified destination WebSocket location and version to initiate.
      Parameters:
      webSocketURL - URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
      version - Version of web socket specification to use to connect to the server
      subprotocol - Sub protocol request sent to the server.
      customHeaders - Map of custom headers to add to the client request
      maxFramePayloadLength - Maximum length of a frame's payload
      forceCloseTimeoutMillis - Close the connection if it was not closed by the server after timeout specified
    • WebSocketClientHandshaker00

      WebSocketClientHandshaker00(URI webSocketURL, WebSocketVersion version, String subprotocol, HttpHeaders customHeaders, int maxFramePayloadLength, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl)
      Creates a new instance with the specified destination WebSocket location and version to initiate.
      Parameters:
      webSocketURL - URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
      version - Version of web socket specification to use to connect to the server
      subprotocol - Sub protocol request sent to the server.
      customHeaders - Map of custom headers to add to the client request
      maxFramePayloadLength - Maximum length of a frame's payload
      forceCloseTimeoutMillis - Close the connection if it was not closed by the server after timeout specified
      absoluteUpgradeUrl - Use an absolute url for the Upgrade request, typically when connecting through an HTTP proxy over clear HTTP
    • WebSocketClientHandshaker00

      WebSocketClientHandshaker00(URI webSocketURL, WebSocketVersion version, String subprotocol, HttpHeaders customHeaders, int maxFramePayloadLength, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl, boolean generateOriginHeader)
      Creates a new instance with the specified destination WebSocket location and version to initiate.
      Parameters:
      webSocketURL - URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
      version - Version of web socket specification to use to connect to the server
      subprotocol - Sub protocol request sent to the server.
      customHeaders - Map of custom headers to add to the client request
      maxFramePayloadLength - Maximum length of a frame's payload
      forceCloseTimeoutMillis - Close the connection if it was not closed by the server after timeout specified
      absoluteUpgradeUrl - Use an absolute url for the Upgrade request, typically when connecting through an HTTP proxy over clear HTTP
      generateOriginHeader - Allows to generate the `Origin` header value for handshake request according to the given webSocketURL
  • Method Details