1 package org.opendaylight.controller.sal.streams.websockets;
3 import io.netty.channel.Channel;
4 import io.netty.channel.ChannelInitializer;
5 import io.netty.channel.ChannelPipeline;
6 import io.netty.channel.socket.SocketChannel;
7 import io.netty.handler.codec.http.HttpObjectAggregator;
8 import io.netty.handler.codec.http.HttpServerCodec;
11 * {@link WebSocketServerInitializer} is used to setup the
12 * {@link ChannelPipeline} of a {@link Channel}.
14 public class WebSocketServerInitializer extends
15 ChannelInitializer<SocketChannel> {
18 protected void initChannel(SocketChannel ch) throws Exception {
19 ChannelPipeline pipeline = ch.pipeline();
20 pipeline.addLast("codec-http", new HttpServerCodec());
21 pipeline.addLast("aggregator", new HttpObjectAggregator(65536));
22 pipeline.addLast("handler", new WebSocketServerHandler());