Top Description Constructors Methods
io.netty5.handler.codec.http.websocketx

public final Class WebSocketClientHandshakerFactory

extends Object
Class Inheritance
Imports
io.netty5.handler.codec.http.headers.HttpHeaders, java.net.URI

Creates a new WebSocketClientHandshaker of desired protocol version.

Constructor Summary

AccessConstructor and Description
private
WebSocketClientHandshakerFactory()

Private constructor so this static class cannot be instanced.

Method Summary

Modifier and TypeMethod and Description
public static WebSocketClientHandshaker
newHandshaker(URI
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
webSocketURL
,
WebSocketVersion
Version of web socket specification to use to connect to the server
version
,
String
Sub protocol request sent to the server. Null if no sub-protocol support is required.
subprotocol
,
boolean
Allow extensions to be used in the reserved bits of the web socket frame
allowExtensions
,
HttpHeaders
Custom HTTP headers to send during the handshake
customHeaders
)

Creates a new handshaker.

public static WebSocketClientHandshaker
newHandshaker(URI
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
webSocketURL
,
WebSocketVersion
Version of web socket specification to use to connect to the server
version
,
String
Sub protocol request sent to the server. Null if no sub-protocol support is required.
subprotocol
,
boolean
Allow extensions to be used in the reserved bits of the web socket frame
allowExtensions
,
HttpHeaders
Custom HTTP headers to send during the handshake
customHeaders
,
int
Maximum allowable frame payload length. Setting this value to your application's requirement may reduce denial of service attacks using long data frames.
maxFramePayloadLength
)

Creates a new handshaker.

public static WebSocketClientHandshaker
newHandshaker(URI
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
webSocketURL
,
WebSocketVersion
Version of web socket specification to use to connect to the server
version
,
String
Sub protocol request sent to the server. Null if no sub-protocol support is required.
subprotocol
,
boolean
Allow extensions to be used in the reserved bits of the web socket frame
allowExtensions
,
HttpHeaders
Custom HTTP headers to send during the handshake
customHeaders
,
int
Maximum allowable frame payload length. Setting this value to your application's requirement may reduce denial of service attacks using long data frames.
maxFramePayloadLength
,
boolean
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.
performMasking
,
boolean
When set to true, frames which are not masked properly according to the standard will still be accepted.
allowMaskMismatch
)

Creates a new handshaker.

public static WebSocketClientHandshaker
newHandshaker(URI
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
webSocketURL
,
WebSocketVersion
Version of web socket specification to use to connect to the server
version
,
String
Sub protocol request sent to the server. Null if no sub-protocol support is required.
subprotocol
,
boolean
Allow extensions to be used in the reserved bits of the web socket frame
allowExtensions
,
HttpHeaders
Custom HTTP headers to send during the handshake
customHeaders
,
int
Maximum allowable frame payload length. Setting this value to your application's requirement may reduce denial of service attacks using long data frames.
maxFramePayloadLength
,
boolean
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.
performMasking
,
boolean
When set to true, frames which are not masked properly according to the standard will still be accepted.
allowMaskMismatch
,
long
Close the connection if it was not closed by the server after timeout specified
forceCloseTimeoutMillis
)

Creates a new handshaker.

public static WebSocketClientHandshaker
newHandshaker(URI
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
webSocketURL
,
WebSocketVersion
Version of web socket specification to use to connect to the server
version
,
String
Sub protocol request sent to the server. Null if no sub-protocol support is required.
subprotocol
,
boolean
Allow extensions to be used in the reserved bits of the web socket frame
allowExtensions
,
HttpHeaders
Custom HTTP headers to send during the handshake
customHeaders
,
int
Maximum allowable frame payload length. Setting this value to your application's requirement may reduce denial of service attacks using long data frames.
maxFramePayloadLength
,
boolean
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.
performMasking
,
boolean
When set to true, frames which are not masked properly according to the standard will still be accepted.
allowMaskMismatch
,
long
Close the connection if it was not closed by the server after timeout specified
forceCloseTimeoutMillis
,
boolean
Use an absolute url for the Upgrade request, typically when connecting through an HTTP proxy over clear HTTP
absoluteUpgradeUrl
)

Creates a new handshaker.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

WebSocketClientHandshakerFactoryback to summary
private WebSocketClientHandshakerFactory()

Private constructor so this static class cannot be instanced.

Method Detail

newHandshakerback to summary
public static WebSocketClientHandshaker newHandshaker(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders)

Creates a new handshaker.

Parameters
webSocketURL:URI

URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.

version:WebSocketVersion

Version of web socket specification to use to connect to the server

subprotocol:String

Sub protocol request sent to the server. Null if no sub-protocol support is required.

allowExtensions:boolean

Allow extensions to be used in the reserved bits of the web socket frame

customHeaders:HttpHeaders

Custom HTTP headers to send during the handshake

newHandshakerback to summary
public static WebSocketClientHandshaker newHandshaker(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength)

Creates a new handshaker.

Parameters
webSocketURL:URI

URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.

version:WebSocketVersion

Version of web socket specification to use to connect to the server

subprotocol:String

Sub protocol request sent to the server. Null if no sub-protocol support is required.

allowExtensions:boolean

Allow extensions to be used in the reserved bits of the web socket frame

customHeaders:HttpHeaders

Custom HTTP headers to send during the handshake

maxFramePayloadLength:int

Maximum allowable frame payload length. Setting this value to your application's requirement may reduce denial of service attacks using long data frames.

newHandshakerback to summary
public static WebSocketClientHandshaker newHandshaker(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch)

Creates a new handshaker.

Parameters
webSocketURL:URI

URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.

version:WebSocketVersion

Version of web socket specification to use to connect to the server

subprotocol:String

Sub protocol request sent to the server. Null if no sub-protocol support is required.

allowExtensions:boolean

Allow extensions to be used in the reserved bits of the web socket frame

customHeaders:HttpHeaders

Custom HTTP headers to send during the handshake

maxFramePayloadLength:int

Maximum allowable frame payload length. Setting this value to your application's requirement may reduce denial of service attacks using long data frames.

performMasking:boolean

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:boolean

When set to true, frames which are not masked properly according to the standard will still be accepted.

newHandshakerback to summary
public static WebSocketClientHandshaker newHandshaker(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis)

Creates a new handshaker.

Parameters
webSocketURL:URI

URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.

version:WebSocketVersion

Version of web socket specification to use to connect to the server

subprotocol:String

Sub protocol request sent to the server. Null if no sub-protocol support is required.

allowExtensions:boolean

Allow extensions to be used in the reserved bits of the web socket frame

customHeaders:HttpHeaders

Custom HTTP headers to send during the handshake

maxFramePayloadLength:int

Maximum allowable frame payload length. Setting this value to your application's requirement may reduce denial of service attacks using long data frames.

performMasking:boolean

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:boolean

When set to true, frames which are not masked properly according to the standard will still be accepted.

forceCloseTimeoutMillis:long

Close the connection if it was not closed by the server after timeout specified

newHandshakerback to summary
public static WebSocketClientHandshaker newHandshaker(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl)

Creates a new handshaker.

Parameters
webSocketURL:URI

URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.

version:WebSocketVersion

Version of web socket specification to use to connect to the server

subprotocol:String

Sub protocol request sent to the server. Null if no sub-protocol support is required.

allowExtensions:boolean

Allow extensions to be used in the reserved bits of the web socket frame

customHeaders:HttpHeaders

Custom HTTP headers to send during the handshake

maxFramePayloadLength:int

Maximum allowable frame payload length. Setting this value to your application's requirement may reduce denial of service attacks using long data frames.

performMasking:boolean

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:boolean

When set to true, frames which are not masked properly according to the standard will still be accepted.

forceCloseTimeoutMillis:long

Close the connection if it was not closed by the server after timeout specified

absoluteUpgradeUrl:boolean

Use an absolute url for the Upgrade request, typically when connecting through an HTTP proxy over clear HTTP