use of io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler in project netty by netty.
the class WebSocketServerInitializer method initChannel.
@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 WebSocketServerProtocolHandler(WEBSOCKET_PATH, null, true));
pipeline.addLast(new WebSocketIndexPageHandler(WEBSOCKET_PATH));
pipeline.addLast(new WebSocketFrameHandler());
}
use of io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler in project zuul by Netflix.
the class SampleWebSocketPushChannelInitializer method addPushHandlers.
@Override
protected void addPushHandlers(final ChannelPipeline pipeline) {
pipeline.addLast(PushAuthHandler.NAME, pushAuthHandler);
pipeline.addLast(new WebSocketServerCompressionHandler());
pipeline.addLast(new WebSocketServerProtocolHandler(PushProtocol.WEBSOCKET.getPath(), null, true));
pipeline.addLast(new PushRegistrationHandler(pushConnectionRegistry, PushProtocol.WEBSOCKET));
pipeline.addLast(new SampleWebSocketPushClientProtocolHandler());
}
Aggregations