2011-10-17 06:12:37 +02:00
|
|
|
/*
|
2012-06-04 22:31:44 +02:00
|
|
|
* Copyright 2012 The Netty Project
|
2011-10-17 06:12:37 +02:00
|
|
|
*
|
2011-12-09 06:18:34 +01:00
|
|
|
* The Netty Project licenses this file to you under the Apache License,
|
|
|
|
* version 2.0 (the "License"); you may not use this file except in compliance
|
|
|
|
* with the License. You may obtain a copy of the License at:
|
2011-10-17 06:12:37 +02:00
|
|
|
*
|
2012-06-04 22:31:44 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2011-10-17 06:12:37 +02:00
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
2011-12-09 06:18:34 +01:00
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
2011-10-17 06:12:37 +02:00
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
|
|
|
*/
|
2017-02-20 14:06:48 +01:00
|
|
|
package io.netty.testsuite.autobahn;
|
2011-10-17 06:12:37 +02:00
|
|
|
|
2012-05-30 01:41:26 +02:00
|
|
|
import io.netty.channel.ChannelInitializer;
|
2011-12-09 04:38:59 +01:00
|
|
|
import io.netty.channel.ChannelPipeline;
|
2012-05-30 01:41:26 +02:00
|
|
|
import io.netty.channel.socket.SocketChannel;
|
2011-12-09 04:38:59 +01:00
|
|
|
import io.netty.handler.codec.http.HttpRequestDecoder;
|
|
|
|
import io.netty.handler.codec.http.HttpResponseEncoder;
|
2011-10-17 06:12:37 +02:00
|
|
|
|
2012-05-30 01:41:26 +02:00
|
|
|
public class AutobahnServerInitializer extends ChannelInitializer<SocketChannel> {
|
2011-12-15 12:25:40 +01:00
|
|
|
@Override
|
2012-05-30 01:41:26 +02:00
|
|
|
public void initChannel(SocketChannel ch) throws Exception {
|
|
|
|
ChannelPipeline pipeline = ch.pipeline();
|
2014-03-05 06:56:21 +01:00
|
|
|
pipeline.addLast("encoder", new HttpResponseEncoder());
|
2011-12-15 12:25:40 +01:00
|
|
|
pipeline.addLast("decoder", new HttpRequestDecoder());
|
2012-01-14 16:17:10 +01:00
|
|
|
pipeline.addLast("handler", new AutobahnServerHandler());
|
2011-12-15 12:25:40 +01:00
|
|
|
}
|
2011-10-17 06:12:37 +02:00
|
|
|
}
|