WebSocketServerHandshaker Class — netty Architecture
Architecture documentation for the WebSocketServerHandshaker class in WebSocketServerHandshaker.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD d6ee024e_a3da_57df_d2af_4ac878a5475e["WebSocketServerHandshaker"] 8173386b_da06_888d_442d_d18b01be94dc["WebSocketServerHandshaker.java"] d6ee024e_a3da_57df_d2af_4ac878a5475e -->|defined in| 8173386b_da06_888d_442d_d18b01be94dc 31218316_5b49_5554_6e68_f825af56fb9f["WebSocketServerHandshaker()"] d6ee024e_a3da_57df_d2af_4ac878a5475e -->|method| 31218316_5b49_5554_6e68_f825af56fb9f 5d181377_84a2_1d34_d8a4_926cc7523e8d["String()"] d6ee024e_a3da_57df_d2af_4ac878a5475e -->|method| 5d181377_84a2_1d34_d8a4_926cc7523e8d 47b1a005_68cd_fb7d_5410_3d345edf96cb["subprotocols()"] d6ee024e_a3da_57df_d2af_4ac878a5475e -->|method| 47b1a005_68cd_fb7d_5410_3d345edf96cb 43b353a4_974a_e127_d857_7a99324eeea2["WebSocketVersion()"] d6ee024e_a3da_57df_d2af_4ac878a5475e -->|method| 43b353a4_974a_e127_d857_7a99324eeea2 a4e4b944_f2d7_d7bb_90a0_bce8d2785e18["maxFramePayloadLength()"] d6ee024e_a3da_57df_d2af_4ac878a5475e -->|method| a4e4b944_f2d7_d7bb_90a0_bce8d2785e18 8655e8d0_3880_b035_6104_c6e15d9580a5["WebSocketDecoderConfig()"] d6ee024e_a3da_57df_d2af_4ac878a5475e -->|method| 8655e8d0_3880_b035_6104_c6e15d9580a5 b00561e6_dae7_65bf_6a5c_46aedc83f7bb["ChannelFuture()"] d6ee024e_a3da_57df_d2af_4ac878a5475e -->|method| b00561e6_dae7_65bf_6a5c_46aedc83f7bb 5ee21b11_fa0f_70b1_f2dc_0d4371a47966["FullHttpResponse()"] d6ee024e_a3da_57df_d2af_4ac878a5475e -->|method| 5ee21b11_fa0f_70b1_f2dc_0d4371a47966 ea9b93ef_44a1_56ca_e5d8_9e152b599818["WebSocketFrameDecoder()"] d6ee024e_a3da_57df_d2af_4ac878a5475e -->|method| ea9b93ef_44a1_56ca_e5d8_9e152b599818 a8fb64e1_1e74_e27a_f18b_2106c8ce72f0["WebSocketFrameEncoder()"] d6ee024e_a3da_57df_d2af_4ac878a5475e -->|method| a8fb64e1_1e74_e27a_f18b_2106c8ce72f0
Relationship Graph
Source Code
codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker.java lines 56–512
public abstract class WebSocketServerHandshaker {
protected static final InternalLogger logger = InternalLoggerFactory.getInstance(WebSocketServerHandshaker.class);
private final String uri;
private final String[] subprotocols;
private final WebSocketVersion version;
private final WebSocketDecoderConfig decoderConfig;
private String selectedSubprotocol;
/**
* Use this as wildcard to support all requested sub-protocols
*/
public static final String SUB_PROTOCOL_WILDCARD = "*";
/**
* Constructor specifying the destination web socket location
*
* @param version
* the protocol version
* @param uri
* URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
* sent to this URL.
* @param subprotocols
* CSV of supported protocols. Null if sub protocols not supported.
* @param maxFramePayloadLength
* Maximum length of a frame's payload
*/
protected WebSocketServerHandshaker(
WebSocketVersion version, String uri, String subprotocols,
int maxFramePayloadLength) {
this(version, uri, subprotocols, WebSocketDecoderConfig.newBuilder()
.maxFramePayloadLength(maxFramePayloadLength)
.build());
}
/**
* Constructor specifying the destination web socket location
*
* @param version
* the protocol version
* @param uri
* URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
* sent to this URL.
* @param subprotocols
* CSV of supported protocols. Null if sub protocols not supported.
* @param decoderConfig
* Frames decoder configuration.
*/
protected WebSocketServerHandshaker(
WebSocketVersion version, String uri, String subprotocols, WebSocketDecoderConfig decoderConfig) {
this.version = version;
this.uri = uri;
if (subprotocols != null) {
String[] subprotocolArray = subprotocols.split(",");
for (int i = 0; i < subprotocolArray.length; i++) {
subprotocolArray[i] = subprotocolArray[i].trim();
}
this.subprotocols = subprotocolArray;
} else {
this.subprotocols = EmptyArrays.EMPTY_STRINGS;
}
this.decoderConfig = ObjectUtil.checkNotNull(decoderConfig, "decoderConfig");
}
/**
* Returns the URL of the web socket
*/
@Deprecated
public String uri() {
return uri;
}
/**
* Returns the CSV of supported sub protocols
*/
public Set<String> subprotocols() {
Set<String> ret = new LinkedHashSet<String>();
Defined In
Source
Frequently Asked Questions
What is the WebSocketServerHandshaker class?
WebSocketServerHandshaker is a class in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker.java.
Where is WebSocketServerHandshaker defined?
WebSocketServerHandshaker is defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker.java at line 56.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free