Home / Class/ WebSocketServerHandshaker00 Class — netty Architecture

WebSocketServerHandshaker00 Class — netty Architecture

Architecture documentation for the WebSocketServerHandshaker00 class in WebSocketServerHandshaker00.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  fd3e511a_9160_60d1_b200_4b0eaf833eef["WebSocketServerHandshaker00"]
  83e61156_c0eb_b51f_27ed_03f4310cc0fe["WebSocketServerHandshaker00.java"]
  fd3e511a_9160_60d1_b200_4b0eaf833eef -->|defined in| 83e61156_c0eb_b51f_27ed_03f4310cc0fe
  a1595cf9_765f_19df_d583_19c9be910d2e["WebSocketServerHandshaker00()"]
  fd3e511a_9160_60d1_b200_4b0eaf833eef -->|method| a1595cf9_765f_19df_d583_19c9be910d2e
  1a5d3195_65f0_e50e_38dd_f386dab79141["FullHttpResponse()"]
  fd3e511a_9160_60d1_b200_4b0eaf833eef -->|method| 1a5d3195_65f0_e50e_38dd_f386dab79141
  41eb3126_db9b_c39a_725d_0f99b9c2f75e["ChannelFuture()"]
  fd3e511a_9160_60d1_b200_4b0eaf833eef -->|method| 41eb3126_db9b_c39a_725d_0f99b9c2f75e
  f37a8391_2320_ba72_93bc_05dfa31bf3f1["WebSocketFrameDecoder()"]
  fd3e511a_9160_60d1_b200_4b0eaf833eef -->|method| f37a8391_2320_ba72_93bc_05dfa31bf3f1
  dbfe4632_926a_f525_907a_f178916a631f["WebSocketFrameEncoder()"]
  fd3e511a_9160_60d1_b200_4b0eaf833eef -->|method| dbfe4632_926a_f525_907a_f178916a631f

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker00.java lines 48–245

public class WebSocketServerHandshaker00 extends WebSocketServerHandshaker {

    private static final Pattern BEGINNING_DIGIT = Pattern.compile("[^0-9]");
    private static final Pattern BEGINNING_SPACE = Pattern.compile("[^ ]");

    /**
     * Constructor specifying the destination web socket location
     *
     * @param webSocketURL
     *            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
     * @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 WebSocketServerHandshaker00(String webSocketURL, String subprotocols, int maxFramePayloadLength) {
        this(webSocketURL, subprotocols, WebSocketDecoderConfig.newBuilder()
            .maxFramePayloadLength(maxFramePayloadLength)
            .build());
    }

    /**
     * Constructor specifying the destination web socket location
     *
     * @param webSocketURL
     *            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
     * @param decoderConfig
     *            Frames decoder configuration.
     */
    public WebSocketServerHandshaker00(String webSocketURL, String subprotocols, WebSocketDecoderConfig decoderConfig) {
        super(WebSocketVersion.V00, webSocketURL, subprotocols, decoderConfig);
    }

    /**
     * <p>
     * Handle the web socket handshake for the web socket specification <a href=
     * "https://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00">HyBi version 0</a> and lower. This standard
     * is really a rehash of <a href="https://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76" >hixie-76</a> and
     * <a href="https://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75" >hixie-75</a>.
     * </p>
     *
     * <p>
     * Browser request to the server:
     * </p>
     *
     * <pre>
     * GET /demo HTTP/1.1
     * Upgrade: WebSocket
     * Connection: Upgrade
     * Host: example.com
     * Origin: http://example.com
     * Sec-WebSocket-Protocol: chat, sample
     * Sec-WebSocket-Key1: 4 @1  46546xW%0l 1 5
     * Sec-WebSocket-Key2: 12998 5 Y3 1  .P00
     *
     * ^n:ds[4U
     * </pre>
     *
     * <p>
     * Server response:
     * </p>
     *
     * <pre>
     * HTTP/1.1 101 WebSocket Protocol Handshake
     * Upgrade: WebSocket
     * Connection: Upgrade
     * Sec-WebSocket-Origin: http://example.com
     * Sec-WebSocket-Location: ws://example.com/demo
     * Sec-WebSocket-Protocol: sample
     *
     * 8jKS'y:G*Co,Wxa-
     * </pre>
     */
    @Override
    protected FullHttpResponse newHandshakeResponse(FullHttpRequest req, HttpHeaders headers) {
        HttpMethod method = req.method();

Frequently Asked Questions

What is the WebSocketServerHandshaker00 class?
WebSocketServerHandshaker00 is a class in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker00.java.
Where is WebSocketServerHandshaker00 defined?
WebSocketServerHandshaker00 is defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker00.java at line 48.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free