Home / Class/ HttpSnoopServerInitializer Class — netty Architecture

HttpSnoopServerInitializer Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  531f50ea_44f4_24b2_0ef0_4389fa51d18d["HttpSnoopServerInitializer"]
  8d3c8993_cffe_1c6e_d721_ff277d392150["HttpSnoopServerInitializer.java"]
  531f50ea_44f4_24b2_0ef0_4389fa51d18d -->|defined in| 8d3c8993_cffe_1c6e_d721_ff277d392150
  e69dc90b_337f_3d80_6eb5_90c42c82fc13["HttpSnoopServerInitializer()"]
  531f50ea_44f4_24b2_0ef0_4389fa51d18d -->|method| e69dc90b_337f_3d80_6eb5_90c42c82fc13
  600c3ea0_fbb7_2d35_4e72_7c0b2a31f3c3["initChannel()"]
  531f50ea_44f4_24b2_0ef0_4389fa51d18d -->|method| 600c3ea0_fbb7_2d35_4e72_7c0b2a31f3c3

Relationship Graph

Source Code

example/src/main/java/io/netty/example/http/snoop/HttpSnoopServerInitializer.java lines 25–47

public class HttpSnoopServerInitializer extends ChannelInitializer<SocketChannel> {

    private final SslContext sslCtx;

    public HttpSnoopServerInitializer(SslContext sslCtx) {
        this.sslCtx = sslCtx;
    }

    @Override
    public void initChannel(SocketChannel ch) {
        ChannelPipeline p = ch.pipeline();
        if (sslCtx != null) {
            p.addLast(sslCtx.newHandler(ch.alloc()));
        }
        p.addLast(new HttpRequestDecoder());
        // Uncomment the following line if you don't want to handle HttpChunks.
        //p.addLast(new HttpObjectAggregator(1048576));
        p.addLast(new HttpResponseEncoder());
        // Remove the following line if you don't want automatic content compression.
        //p.addLast(new HttpContentCompressor((CompressionOptions[]) null));
        p.addLast(new HttpSnoopServerHandler());
    }
}

Frequently Asked Questions

What is the HttpSnoopServerInitializer class?
HttpSnoopServerInitializer is a class in the netty codebase, defined in example/src/main/java/io/netty/example/http/snoop/HttpSnoopServerInitializer.java.
Where is HttpSnoopServerInitializer defined?
HttpSnoopServerInitializer is defined in example/src/main/java/io/netty/example/http/snoop/HttpSnoopServerInitializer.java at line 25.

Analyze Your Own Codebase

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

Try Supermodel Free