Class WebSocketClientHandshakerFactory
- java.lang.Object
-
- io.netty.handler.codec.http.websocketx.WebSocketClientHandshakerFactory
-
public final class WebSocketClientHandshakerFactory extends java.lang.ObjectCreates a newWebSocketClientHandshakerof desired protocol version.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static WebSocketClientHandshakernewHandshaker(java.net.URI webSocketURL, WebSocketVersion version, java.lang.String subprotocol, boolean allowExtensions, HttpHeaders customHeaders)Creates a new handshaker.static WebSocketClientHandshakernewHandshaker(java.net.URI webSocketURL, WebSocketVersion version, java.lang.String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength)Creates a new handshaker.static WebSocketClientHandshakernewHandshaker(java.net.URI webSocketURL, WebSocketVersion version, java.lang.String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch)Creates a new handshaker.static WebSocketClientHandshakernewHandshaker(java.net.URI webSocketURL, WebSocketVersion version, java.lang.String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis)Creates a new handshaker.static WebSocketClientHandshakernewHandshaker(java.net.URI webSocketURL, WebSocketVersion version, java.lang.String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl)Creates a new handshaker.static WebSocketClientHandshakernewHandshaker(java.net.URI webSocketURL, WebSocketVersion version, java.lang.String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl, boolean generateOriginHeader)Creates a new handshaker.
-
-
-
Method Detail
-
newHandshaker
public static WebSocketClientHandshaker newHandshaker(java.net.URI webSocketURL, WebSocketVersion version, java.lang.String subprotocol, boolean allowExtensions, HttpHeaders customHeaders)
Creates 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 serversubprotocol- 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 framecustomHeaders- Custom HTTP headers to send during the handshake
-
newHandshaker
public static WebSocketClientHandshaker newHandshaker(java.net.URI webSocketURL, WebSocketVersion version, java.lang.String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength)
Creates 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 serversubprotocol- 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 framecustomHeaders- Custom HTTP headers to send during the handshakemaxFramePayloadLength- Maximum allowable frame payload length. Setting this value to your application's requirement may reduce denial of service attacks using long data frames.
-
newHandshaker
public static WebSocketClientHandshaker newHandshaker(java.net.URI webSocketURL, WebSocketVersion version, java.lang.String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch)
Creates 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 serversubprotocol- 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 framecustomHeaders- Custom HTTP headers to send during the handshakemaxFramePayloadLength- Maximum allowable frame payload length. Setting this value to your application's requirement may reduce denial of service attacks using long data frames.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.
-
newHandshaker
public static WebSocketClientHandshaker newHandshaker(java.net.URI webSocketURL, WebSocketVersion version, java.lang.String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis)
Creates 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 serversubprotocol- 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 framecustomHeaders- Custom HTTP headers to send during the handshakemaxFramePayloadLength- Maximum allowable frame payload length. Setting this value to your application's requirement may reduce denial of service attacks using long data frames.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
-
newHandshaker
public static WebSocketClientHandshaker newHandshaker(java.net.URI webSocketURL, WebSocketVersion version, java.lang.String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl)
Creates 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 serversubprotocol- 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 framecustomHeaders- Custom HTTP headers to send during the handshakemaxFramePayloadLength- Maximum allowable frame payload length. Setting this value to your application's requirement may reduce denial of service attacks using long data frames.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 specifiedabsoluteUpgradeUrl- Use an absolute url for the Upgrade request, typically when connecting through an HTTP proxy over clear HTTP
-
newHandshaker
public static WebSocketClientHandshaker newHandshaker(java.net.URI webSocketURL, WebSocketVersion version, java.lang.String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl, boolean generateOriginHeader)
Creates 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 serversubprotocol- 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 framecustomHeaders- Custom HTTP headers to send during the handshakemaxFramePayloadLength- Maximum allowable frame payload length. Setting this value to your application's requirement may reduce denial of service attacks using long data frames.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 specifiedabsoluteUpgradeUrl- Use an absolute url for the Upgrade request, typically when connecting through an HTTP proxy over clear HTTPgenerateOriginHeader- Allows to generate the `Origin`|`Sec-WebSocket-Origin` header value for handshake request according to the given webSocketURL
-
-