Class WebSocketClientHandshakerFactory


  • public class WebSocketClientHandshakerFactory
    extends java.lang.Object
    Instances the appropriate handshake class to use for clients
    • Constructor Detail

      • WebSocketClientHandshakerFactory

        public WebSocketClientHandshakerFactory()
    • Method Detail

      • newHandshaker

        public WebSocketClientHandshaker newHandshaker​(java.net.URI webSocketURL,
                                                       WebSocketVersion version,
                                                       java.lang.String subprotocol,
                                                       boolean allowExtensions,
                                                       java.util.Map<java.lang.String,​java.lang.String> customHeaders)
        Instances a new handshaker
        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. Null if no sub-protocol support is required.
        allowExtensions - Allow extensions to be used in the reserved bits of the web socket frame
        customHeaders - Custom HTTP headers to send during the handshake
        Throws:
        WebSocketHandshakeException
      • newHandshaker

        public WebSocketClientHandshaker newHandshaker​(java.net.URI webSocketURL,
                                                       WebSocketVersion version,
                                                       java.lang.String subprotocol,
                                                       boolean allowExtensions,
                                                       java.util.Map<java.lang.String,​java.lang.String> customHeaders,
                                                       long maxFramePayloadLength)
        Instances a new handshaker
        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. Null if no sub-protocol support is required.
        allowExtensions - Allow extensions to be used in the reserved bits of the web socket frame
        customHeaders - Custom HTTP headers to send during the handshake
        maxFramePayloadLength - Maximum allowable frame payload length. Setting this value to your application's requirement may reduce denial of service attacks using long data frames.
        Throws:
        WebSocketHandshakeException