package org.opendaylight.controller.sal.streams.websockets; import io.netty.channel.ChannelInitializer; 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; /** * {@link WebSocketServerInitializer} is used to setup the * {@link ChannelPipeline} of a {@link io.netty.channel.Channel}. */ public class WebSocketServerInitializer extends ChannelInitializer { @Override protected void initChannel(final SocketChannel ch) throws Exception { ChannelPipeline pipeline = ch.pipeline(); pipeline.addLast("codec-http", new HttpServerCodec()); pipeline.addLast("aggregator", new HttpObjectAggregator(65536)); pipeline.addLast("handler", new WebSocketServerHandler()); } }