【发布时间】:2015-11-18 03:47:50
【问题描述】:
在来自 netty 存储库的 WebSocket-Server example 中,WebSocket-Server 像这样初始化
@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(65536));
pipeline.addLast(new WebSocketServerCompressionHandler());
pipeline.addLast(new WebSocketServerHandler());
}
但是 WebSocketServerCompressionHandler 没有随 netty-all 包一起提供。这是一个过时的例子还是我错过了另一个包。
【问题讨论】:
标签: java websocket server netty