WebSocketServerInitializer Class — netty Architecture
Architecture documentation for the WebSocketServerInitializer class in WebSocketServerInitializer.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD d91b1dd0_4fdc_4b4f_37dd_0c0e86c4c19a["WebSocketServerInitializer"] 5ae8c92b_27f9_0c03_d6f0_6d4a7454525a["WebSocketServerInitializer.java"] d91b1dd0_4fdc_4b4f_37dd_0c0e86c4c19a -->|defined in| 5ae8c92b_27f9_0c03_d6f0_6d4a7454525a 86e4c65b_7fea_424f_9a38_ff4eb27f6797["WebSocketServerInitializer()"] d91b1dd0_4fdc_4b4f_37dd_0c0e86c4c19a -->|method| 86e4c65b_7fea_424f_9a38_ff4eb27f6797 4d20e1b9_236d_40fa_13a4_5f78835b5ce4["initChannel()"] d91b1dd0_4fdc_4b4f_37dd_0c0e86c4c19a -->|method| 4d20e1b9_236d_40fa_13a4_5f78835b5ce4
Relationship Graph
Source Code
example/src/main/java/io/netty/example/http/websocketx/server/WebSocketServerInitializer.java lines 29–54
public class WebSocketServerInitializer extends ChannelInitializer<SocketChannel> {
private static final String WEBSOCKET_PATH = "/websocket";
private static final int MAX_CONTENT_LENGTH = 65536;
private final SslContext sslCtx;
public WebSocketServerInitializer(SslContext sslCtx) {
this.sslCtx = sslCtx;
}
@Override
public void initChannel(SocketChannel ch) throws Exception {
ChannelPipeline pipeline = ch.pipeline();
if (sslCtx != null) {
pipeline.addLast(sslCtx.newHandler(ch.alloc()));
}
pipeline.addLast(new HttpServerCodec());
pipeline.addLast(new HttpObjectAggregator(MAX_CONTENT_LENGTH));
pipeline.addLast(new WebSocketIndexPageHandler(WEBSOCKET_PATH));
pipeline.addLast(new WebSocketServerCompressionHandler(MAX_CONTENT_LENGTH));
pipeline.addLast(new WebSocketServerProtocolHandler(WEBSOCKET_PATH, null, true));
pipeline.addLast(new WebSocketFrameHandler());
}
}
Defined In
Source
Frequently Asked Questions
What is the WebSocketServerInitializer class?
WebSocketServerInitializer is a class in the netty codebase, defined in example/src/main/java/io/netty/example/http/websocketx/server/WebSocketServerInitializer.java.
Where is WebSocketServerInitializer defined?
WebSocketServerInitializer is defined in example/src/main/java/io/netty/example/http/websocketx/server/WebSocketServerInitializer.java at line 29.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free