HttpSnoopServer Class — netty Architecture
Architecture documentation for the HttpSnoopServer class in HttpSnoopServer.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 0843600d_a6df_73c2_2811_7799e9a0134c["HttpSnoopServer"] 8872346c_3cbf_f275_e953_ebc190cbb881["HttpSnoopServer.java"] 0843600d_a6df_73c2_2811_7799e9a0134c -->|defined in| 8872346c_3cbf_f275_e953_ebc190cbb881 fc6a74a5_67f8_394c_5da9_ff902e2f5bab["main()"] 0843600d_a6df_73c2_2811_7799e9a0134c -->|method| fc6a74a5_67f8_394c_5da9_ff902e2f5bab
Relationship Graph
Source Code
example/src/main/java/io/netty/example/http/snoop/HttpSnoopServer.java lines 33–61
public final class HttpSnoopServer {
static final boolean SSL = System.getProperty("ssl") != null;
static final int PORT = Integer.parseInt(System.getProperty("port", SSL? "8443" : "8080"));
public static void main(String[] args) throws Exception {
// Configure SSL.
final SslContext sslCtx = ServerUtil.buildSslContext();
// Configure the server.
EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
try {
ServerBootstrap b = new ServerBootstrap();
b.group(group)
.channel(NioServerSocketChannel.class)
.handler(new LoggingHandler(LogLevel.INFO))
.childHandler(new HttpSnoopServerInitializer(sslCtx));
Channel ch = b.bind(PORT).sync().channel();
System.err.println("Open your web browser and navigate to " +
(SSL? "https" : "http") + "://127.0.0.1:" + PORT + '/');
ch.closeFuture().sync();
} finally {
group.shutdownGracefully();
}
}
}
Source
Frequently Asked Questions
What is the HttpSnoopServer class?
HttpSnoopServer is a class in the netty codebase, defined in example/src/main/java/io/netty/example/http/snoop/HttpSnoopServer.java.
Where is HttpSnoopServer defined?
HttpSnoopServer is defined in example/src/main/java/io/netty/example/http/snoop/HttpSnoopServer.java at line 33.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free