use of com.weicoder.netty.handler.WebSocketHandler in project weicoder by wdcode.
the class WebSocketServer method handler.
@Override
protected ChannelHandler handler() {
return new ChannelInitializer<SocketChannel>() {
@Override
public void initChannel(final SocketChannel ch) throws Exception {
ch.pipeline().addLast(new HttpServerCodec());
ch.pipeline().addLast(new HttpObjectAggregator(1024 * 1024));
ch.pipeline().addLast(new WebSocketHandler("websocket"));
ch.config().setAllocator(PooledByteBufAllocator.DEFAULT);
}
};
}
Aggregations