Class WebSocketClientHandshaker07

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

public class WebSocketClientHandshaker07 extends WebSocketClientHandshaker

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

  • Field Details

    • logger

      private static final InternalLogger logger
    • MAGIC_GUID

      public static final String MAGIC_GUID
      See Also:
    • expectedChallengeResponseString

      private String expectedChallengeResponseString
    • allowExtensions

      private final boolean allowExtensions
    • performMasking

      private final boolean performMasking
    • allowMaskMismatch

      private final boolean allowMaskMismatch
  • Constructor Details

    • WebSocketClientHandshaker07

      public WebSocketClientHandshaker07(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength)
      Creates a new instance.
      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.
      allowExtensions - Allow extensions to be used in the reserved bits of the web socket frame
      customHeaders - Map of custom headers to add to the client request
      maxFramePayloadLength - Maximum length of a frame's payload
    • WebSocketClientHandshaker07

      public WebSocketClientHandshaker07(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch)
      Creates a new instance.
      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.
      allowExtensions - Allow extensions to be used in the reserved bits of the web socket frame
      customHeaders - Map of custom headers to add to the client request
      maxFramePayloadLength - Maximum length of a frame's payload
      performMasking - Whether to mask all written websocket frames. This must be set to true in order to be fully compatible with the websocket specifications. Client applications that communicate with a non-standard server which doesn't require masking might set this to false to achieve a higher performance.
      allowMaskMismatch - When set to true, frames which are not masked properly according to the standard will still be accepted.
    • WebSocketClientHandshaker07

      public WebSocketClientHandshaker07(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis)
      Creates a new instance.
      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.
      allowExtensions - Allow extensions to be used in the reserved bits of the web socket frame
      customHeaders - Map of custom headers to add to the client request
      maxFramePayloadLength - Maximum length of a frame's payload
      performMasking - Whether to mask all written websocket frames. This must be set to true in order to be fully compatible with the websocket specifications. Client applications that communicate with a non-standard server which doesn't require masking might set this to false to achieve a higher performance.
      allowMaskMismatch - When set to true, frames which are not masked properly according to the standard will still be accepted
      forceCloseTimeoutMillis - Close the connection if it was not closed by the server after timeout specified.
    • WebSocketClientHandshaker07

      WebSocketClientHandshaker07(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl)
      Creates a new instance.
      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.
      allowExtensions - Allow extensions to be used in the reserved bits of the web socket frame
      customHeaders - Map of custom headers to add to the client request
      maxFramePayloadLength - Maximum length of a frame's payload
      performMasking - Whether to mask all written websocket frames. This must be set to true in order to be fully compatible with the websocket specifications. Client applications that communicate with a non-standard server which doesn't require masking might set this to false to achieve a higher performance.
      allowMaskMismatch - When set to true, frames which are not masked properly according to the standard will still be accepted
      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
    • WebSocketClientHandshaker07

      WebSocketClientHandshaker07(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl, boolean generateOriginHeader)
      Creates a new instance.
      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.
      allowExtensions - Allow extensions to be used in the reserved bits of the web socket frame
      customHeaders - Map of custom headers to add to the client request
      maxFramePayloadLength - Maximum length of a frame's payload
      performMasking - Whether to mask all written websocket frames. This must be set to true in order to be fully compatible with the websocket specifications. Client applications that communicate with a non-standard server which doesn't require masking might set this to false to achieve a higher performance.
      allowMaskMismatch - When set to true, frames which are not masked properly according to the standard will still be accepted
      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 a `Sec-WebSocket-Origin` header value for handshake request according to the given webSocketURL
  • Method Details