1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.testsuite.autobahn;
17
18 import io.netty.channel.ChannelInitializer;
19 import io.netty.channel.ChannelPipeline;
20 import io.netty.channel.socket.SocketChannel;
21 import io.netty.handler.codec.http.HttpRequestDecoder;
22 import io.netty.handler.codec.http.HttpResponseEncoder;
23
24 public class AutobahnServerInitializer extends ChannelInitializer<SocketChannel> {
25 @Override
26 public void initChannel(SocketChannel ch) throws Exception {
27 ChannelPipeline pipeline = ch.pipeline();
28 pipeline.addLast("encoder", new HttpResponseEncoder());
29 pipeline.addLast("decoder", new HttpRequestDecoder());
30 pipeline.addLast("handler", new AutobahnServerHandler());
31 }
32 }