2 * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.netconf.sal.streams.websockets;
11 import io.netty.channel.ChannelInitializer;
12 import io.netty.channel.ChannelPipeline;
13 import io.netty.channel.socket.SocketChannel;
14 import io.netty.handler.codec.http.HttpObjectAggregator;
15 import io.netty.handler.codec.http.HttpServerCodec;
18 * {@link WebSocketServerInitializer} is used to setup the {@link ChannelPipeline} of a {@link io.netty.channel.Channel}
21 public class WebSocketServerInitializer extends ChannelInitializer<SocketChannel> {
24 protected void initChannel(final SocketChannel ch) {
25 ChannelPipeline pipeline = ch.pipeline();
26 pipeline.addLast("codec-http", new HttpServerCodec());
27 pipeline.addLast("aggregator", new HttpObjectAggregator(65536));
28 pipeline.addLast("handler", new WebSocketServerHandler());