use of org.jboss.netty.handler.codec.http.HttpRequestDecoder in project load-balancer by RestComm.
the class ServerPipelineFactory method getPipeline.
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = pipeline();
pipeline.addLast("decoder", new HttpRequestDecoder());
pipeline.addLast("aggregator", new HttpChunkAggregator(1048576));
pipeline.addLast("encoder", new HttpResponseEncoder());
pipeline.addLast("handler", new HttpRequestHandler(listener));
return pipeline;
}
use of org.jboss.netty.handler.codec.http.HttpRequestDecoder in project load-balancer by RestComm.
the class TestHttpServerPipelineFactory method getPipeline.
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = pipeline();
if (!terminateTLSTraffic) {
SslConfiguration sslConfig = new SslConfiguration();
sslConfig.setKeyStorePath(TestHttpServerPipelineFactory.class.getClassLoader().getResource("keystore").getFile());
sslConfig.setKeyStorePassword("123456");
sslConfig.setTrustStorePath(TestHttpServerPipelineFactory.class.getClassLoader().getResource("keystore").getFile());
sslConfig.setTrustStorePassword("123456");
SslContextFactory factory = new SslContextFactory(sslConfig);
SSLEngine sslEngine = factory.newSslEngine();
sslEngine.setUseClientMode(false);
pipeline.addLast("ssl", new SslHandler(sslEngine));
}
pipeline.addLast("decoder", new HttpRequestDecoder());
// http://code.google.com/p/commscale/issues/detail?id=5 support for HttpChunks
// https://telestax.atlassian.net/browse/LB-8 if commented accessing the RestComm Management console fails, so making the maxContentLength Configurable
pipeline.addLast("aggregator", new HttpChunkAggregator(maxContentLength));
pipeline.addLast("encoder", new HttpResponseEncoder());
// Remove the following line if you don't want automatic content compression.
// pipeline.addLast("deflater", new HttpContentCompressor());
pipeline.addLast("handler", new HttpServerRequestHandler(requestCount, requests, chunkResponse, badSever));
return pipeline;
}
Aggregations