[#5045] Fix websockets server example which was broken by 2e6544f

Motivation:

While backport the change from 4.1 to 4.0 I somehow missed to port one line and so broke the example.

Modifications:

Add needed handler which was missing due bad merge commit.

Result:

Example works again in 4.0
This commit is contained in:
Norman Maurer 2016-03-30 10:23:32 +02:00
parent 6a4a9f7493
commit 949bfdf8c5

View File

@ -20,6 +20,7 @@ import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpObjectAggregator;
import io.netty.handler.codec.http.HttpServerCodec;
import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler;
import io.netty.handler.ssl.SslContext;
/**
@ -42,6 +43,7 @@ public class WebSocketServerInitializer extends ChannelInitializer<SocketChannel
}
pipeline.addLast(new HttpServerCodec());
pipeline.addLast(new HttpObjectAggregator(65536));
pipeline.addLast(new WebSocketServerProtocolHandler(WEBSOCKET_PATH, null, true));
pipeline.addLast(new WebSocketIndexPageHandler(WEBSOCKET_PATH));
pipeline.addLast(new WebSocketFrameHandler());
}