Home / Class/ HttpSnoopClientInitializer Class — netty Architecture

HttpSnoopClientInitializer Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  17689a98_2282_7dbe_d47a_7f2c847601c2["HttpSnoopClientInitializer"]
  71671e49_532c_24cf_2b12_5ba9a57b61ba["HttpSnoopClientInitializer.java"]
  17689a98_2282_7dbe_d47a_7f2c847601c2 -->|defined in| 71671e49_532c_24cf_2b12_5ba9a57b61ba
  8bce8c2b_4599_7f3a_f031_c8b763577ccd["HttpSnoopClientInitializer()"]
  17689a98_2282_7dbe_d47a_7f2c847601c2 -->|method| 8bce8c2b_4599_7f3a_f031_c8b763577ccd
  7d8da5a3_2d9f_dcac_f35d_ce565ee11217["initChannel()"]
  17689a98_2282_7dbe_d47a_7f2c847601c2 -->|method| 7d8da5a3_2d9f_dcac_f35d_ce565ee11217

Relationship Graph

Source Code

example/src/main/java/io/netty/example/http/snoop/HttpSnoopClientInitializer.java lines 25–54

public class HttpSnoopClientInitializer extends ChannelInitializer<SocketChannel> {

    private static final int MAX_CONTENT_LENGTH = 65536;

    private final SslContext sslCtx;

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

    @Override
    public void initChannel(SocketChannel ch) {
        ChannelPipeline p = ch.pipeline();

        // Enable HTTPS if necessary.
        if (sslCtx != null) {
            p.addLast(sslCtx.newHandler(ch.alloc()));
        }

        p.addLast(new HttpClientCodec());

        // Remove the following line if you don't want automatic content decompression.
        p.addLast(new HttpContentDecompressor(MAX_CONTENT_LENGTH));

        // Uncomment the following line if you don't want to handle HttpContents.
        //p.addLast(new HttpObjectAggregator(1048576));

        p.addLast(new HttpSnoopClientHandler());
    }
}

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free