2 * Copyright (c) 2016 Wipro Ltd. 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.mwtn.impl.websocket;
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;
17 public class WebSocketServerInitializer extends ChannelInitializer<SocketChannel> {
19 public void initChannel(SocketChannel ch) throws Exception {
20 ChannelPipeline pipeline = ch.pipeline();
21 pipeline.addLast("codec-http", new HttpServerCodec());
22 pipeline.addLast("aggregator", new HttpObjectAggregator(65536));
23 pipeline.addLast("handler", new WebSocketServerHandler());