WebSocketClientHandshakerFactory Class — netty Architecture
Architecture documentation for the WebSocketClientHandshakerFactory class in WebSocketClientHandshakerFactory.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 7a81c174_0b57_da0e_4bcc_b80537ed302e["WebSocketClientHandshakerFactory"] e0a56d06_08ff_c1f4_50ab_b3bdc1974e82["WebSocketClientHandshakerFactory.java"] 7a81c174_0b57_da0e_4bcc_b80537ed302e -->|defined in| e0a56d06_08ff_c1f4_50ab_b3bdc1974e82 d4b4cc26_618f_6bec_b017_b134954f9499["WebSocketClientHandshakerFactory()"] 7a81c174_0b57_da0e_4bcc_b80537ed302e -->|method| d4b4cc26_618f_6bec_b017_b134954f9499 ffdebcd5_6198_dec3_7e66_67723694f063["WebSocketClientHandshaker()"] 7a81c174_0b57_da0e_4bcc_b80537ed302e -->|method| ffdebcd5_6198_dec3_7e66_67723694f063
Relationship Graph
Source Code
codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshakerFactory.java lines 27–290
public final class WebSocketClientHandshakerFactory {
/**
* Private constructor so this static class cannot be instanced.
*/
private WebSocketClientHandshakerFactory() {
}
/**
* Creates a new handshaker.
*
* @param webSocketURL
* URL for web socket communications. e.g "ws://myhost.com/mypath".
* Subsequent web socket frames will be sent to this URL.
* @param version
* Version of web socket specification to use to connect to the server
* @param subprotocol
* Sub protocol request sent to the server. Null if no sub-protocol support is required.
* @param allowExtensions
* Allow extensions to be used in the reserved bits of the web socket frame
* @param customHeaders
* Custom HTTP headers to send during the handshake
*/
public static WebSocketClientHandshaker newHandshaker(
URI webSocketURL, WebSocketVersion version, String subprotocol,
boolean allowExtensions, HttpHeaders customHeaders) {
return newHandshaker(webSocketURL, version, subprotocol, allowExtensions, customHeaders, 65536);
}
/**
* Creates a new handshaker.
*
* @param webSocketURL
* URL for web socket communications. e.g "ws://myhost.com/mypath".
* Subsequent web socket frames will be sent to this URL.
* @param version
* Version of web socket specification to use to connect to the server
* @param subprotocol
* Sub protocol request sent to the server. Null if no sub-protocol support is required.
* @param allowExtensions
* Allow extensions to be used in the reserved bits of the web socket frame
* @param customHeaders
* Custom HTTP headers to send during the handshake
* @param maxFramePayloadLength
* Maximum allowable frame payload length. Setting this value to your application's
* requirement may reduce denial of service attacks using long data frames.
*/
public static WebSocketClientHandshaker newHandshaker(
URI webSocketURL, WebSocketVersion version, String subprotocol,
boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength) {
return newHandshaker(webSocketURL, version, subprotocol, allowExtensions, customHeaders,
maxFramePayloadLength, true, false);
}
/**
* Creates a new handshaker.
*
* @param webSocketURL
* URL for web socket communications. e.g "ws://myhost.com/mypath".
* Subsequent web socket frames will be sent to this URL.
* @param version
* Version of web socket specification to use to connect to the server
* @param subprotocol
* Sub protocol request sent to the server. Null if no sub-protocol support is required.
* @param allowExtensions
* Allow extensions to be used in the reserved bits of the web socket frame
* @param customHeaders
* Custom HTTP headers to send during the handshake
* @param maxFramePayloadLength
* Maximum allowable frame payload length. Setting this value to your application's
* requirement may reduce denial of service attacks using long data frames.
* @param 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.
* @param allowMaskMismatch
* When set to true, frames which are not masked properly according to the standard will still be
* accepted.
*/
public static WebSocketClientHandshaker newHandshaker(
URI webSocketURL, WebSocketVersion version, String subprotocol,
Source
Frequently Asked Questions
What is the WebSocketClientHandshakerFactory class?
WebSocketClientHandshakerFactory is a class in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshakerFactory.java.
Where is WebSocketClientHandshakerFactory defined?
WebSocketClientHandshakerFactory is defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshakerFactory.java at line 27.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free