Home / Class/ WebSocketServerHandshakerFactory Class — netty Architecture

WebSocketServerHandshakerFactory Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  491c7d69_4239_449e_6140_fcf87315c86c["WebSocketServerHandshakerFactory"]
  245f99cc_e4bf_0bed_ace3_3de3003c264d["WebSocketServerHandshakerFactory.java"]
  491c7d69_4239_449e_6140_fcf87315c86c -->|defined in| 245f99cc_e4bf_0bed_ace3_3de3003c264d
  9b762c5f_0c68_0b53_8dbd_a5aab245619c["WebSocketServerHandshakerFactory()"]
  491c7d69_4239_449e_6140_fcf87315c86c -->|method| 9b762c5f_0c68_0b53_8dbd_a5aab245619c
  69c87535_3a18_b568_55eb_6d7dd91b4eec["WebSocketServerHandshaker()"]
  491c7d69_4239_449e_6140_fcf87315c86c -->|method| 69c87535_3a18_b568_55eb_6d7dd91b4eec
  0679b3f4_9c89_0fa4_b1b3_53bf2336aa0d["sendUnsupportedWebSocketVersionResponse()"]
  491c7d69_4239_449e_6140_fcf87315c86c -->|method| 0679b3f4_9c89_0fa4_b1b3_53bf2336aa0d
  a90fe4ba_2182_2151_c228_f15a3df11461["ChannelFuture()"]
  491c7d69_4239_449e_6140_fcf87315c86c -->|method| a90fe4ba_2182_2151_c228_f15a3df11461

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshakerFactory.java lines 34–211

public class WebSocketServerHandshakerFactory {

    private final String webSocketURL;

    private final String subprotocols;

    private final WebSocketDecoderConfig decoderConfig;

    /**
     * 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. Null if sub protocols not supported.
     * @param allowExtensions
     *            Allow extensions to be used in the reserved bits of the web socket frame
     */
    public WebSocketServerHandshakerFactory(
            String webSocketURL, String subprotocols, boolean allowExtensions) {
        this(webSocketURL, subprotocols, allowExtensions, 65536);
    }

    /**
     * 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. Null if sub protocols not supported.
     * @param allowExtensions
     *            Allow extensions to be used in the reserved bits of the web socket frame
     * @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 WebSocketServerHandshakerFactory(
            String webSocketURL, String subprotocols, boolean allowExtensions,
            int maxFramePayloadLength) {
        this(webSocketURL, subprotocols, allowExtensions, maxFramePayloadLength, false);
    }

    /**
     * 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. Null if sub protocols not supported.
     * @param allowExtensions
     *            Allow extensions to be used in the reserved bits of the web socket frame
     * @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 allowMaskMismatch
     *            When set to true, frames which are not masked properly according to the standard will still be
     *            accepted.
     */
    public WebSocketServerHandshakerFactory(
            String webSocketURL, String subprotocols, boolean allowExtensions,
            int maxFramePayloadLength, boolean allowMaskMismatch) {
        this(webSocketURL, subprotocols, WebSocketDecoderConfig.newBuilder()
            .allowExtensions(allowExtensions)
            .maxFramePayloadLength(maxFramePayloadLength)
            .allowMaskMismatch(allowMaskMismatch)
            .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. Null if sub protocols not supported.
     * @param decoderConfig
     *            Frames decoder options.

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free