Package org.jboss.netty.handler.codec.http

Examples of org.jboss.netty.handler.codec.http.HttpRequestDecoder


        // Uncomment the following line if you want HTTPS
        //SSLEngine engine = SecureChatSslContextFactory.getServerContext().createSSLEngine();
        //engine.setUseClientMode(false);
        //pipeline.addLast("ssl", new SslHandler(engine));

        pipeline.addLast("decoder", new HttpRequestDecoder());
        // Uncomment the following line if you don't want to handle HttpChunks.
        //pipeline.addLast("aggregator", new HttpChunkAggregator(1048576));
        pipeline.addLast("encoder", new HttpResponseEncoder());
        // Remove the following line if you don't want automatic content compression.
        pipeline.addLast("deflater", new HttpContentCompressor());
View Full Code Here


        // Uncomment the following lines if you want HTTPS
        //SSLEngine engine = SecureChatSslContextFactory.getServerContext().createSSLEngine();
        //engine.setUseClientMode(false);
        //pipeline.addLast("ssl", new SslHandler(engine));

        pipeline.addLast("decoder", new HttpRequestDecoder());
        pipeline.addLast("aggregator", new HttpChunkAggregator(65536));
        pipeline.addLast("encoder", new HttpResponseEncoder());
        pipeline.addLast("chunkedWriter", new ChunkedWriteHandler());

        pipeline.addLast("handler", new HttpStaticFileServerHandler());
View Full Code Here

*/
public class AutobahnServerPipelineFactory implements ChannelPipelineFactory {
    public ChannelPipeline getPipeline() throws Exception {
        // Create a default pipeline implementation.
        ChannelPipeline pipeline = pipeline();
        pipeline.addLast("decoder", new HttpRequestDecoder());
        pipeline.addLast("aggregator", new HttpChunkAggregator(65536));
        pipeline.addLast("encoder", new HttpResponseEncoder());
        pipeline.addLast("handler", new AutobahnServerHandler());
        return pipeline;
    }
View Full Code Here

public class WebSocketServerPipelineFactory implements ChannelPipelineFactory {
    public ChannelPipeline getPipeline() throws Exception {
        // Create a default pipeline implementation.
        ChannelPipeline pipeline = pipeline();
        pipeline.addLast("decoder", new HttpRequestDecoder());
        pipeline.addLast("aggregator", new HttpChunkAggregator(65536));
        pipeline.addLast("encoder", new HttpResponseEncoder());
        pipeline.addLast("handler", new WebSocketServerProtocolHandler("/websocket"));
        pipeline.addLast("testFramehandler", new CustomTextFrameHandler());
        return pipeline;
View Full Code Here

        return decoder;
    }

    private static DecoderEmbedder<Object> decoderEmbedder() {
        DecoderEmbedder<Object> decoder = new DecoderEmbedder<Object>(
                new HttpRequestDecoder(),
                new WebSocketServerProtocolHandler("path"));
        return decoder;
    }
View Full Code Here

        p.remove(this);
    }

    private void switchToHttp(ChannelHandlerContext ctx) {
        ChannelPipeline p = ctx.getPipeline();
        p.addLast("decoder", new HttpRequestDecoder());
        p.addLast("encoder", new HttpResponseEncoder());
        p.addLast("deflater", new HttpContentCompressor());
        p.addLast("handler", new HttpSnoopServerHandler());
        p.remove(this);
    }
View Full Code Here

  }
 
  @Override
  public ChannelPipeline getPipeline() {
    ChannelPipeline pipeline = Channels.pipeline();
    pipeline.addLast("decoder", new HttpRequestDecoder());
    pipeline.addLast("encoder", new HttpResponseEncoder());
   
    pipeline.addLast("idle", IdleUtils.DEFAULT);
    pipeline.addLast("handler", channelHandler);
   
View Full Code Here

            SSLEngine engine = sslContext.createSSLEngine();
            engine.setUseClientMode(false);
            pipeline.addLast(SSL_HANDLER, new SslHandler(engine));
        }

        pipeline.addLast(HTTP_REQUEST_DECODER, new HttpRequestDecoder());
        pipeline.addLast(HTTP_AGGREGATOR, new HttpChunkAggregator(configuration.getMaxHttpContentLength()));
        pipeline.addLast(HTTP_ENCODER, new HttpResponseEncoder());

        if (isFlashTransport) {
            pipeline.addLast(RESOURCE_HANDLER, resourceHandler);
View Full Code Here

    @Override
    public ChannelPipeline getPipeline() throws Exception {
        ChannelPipeline pipeline = Channels.pipeline();
        pipeline.addLast("openChannels", transport.serverOpenChannels);
        HttpRequestDecoder requestDecoder = new HttpRequestDecoder(
                (int) transport.maxInitialLineLength.bytes(),
                (int) transport.maxHeaderSize.bytes(),
                (int) transport.maxChunkSize.bytes());
        if (transport.maxCumulationBufferCapacity != null) {
            if (transport.maxCumulationBufferCapacity.bytes() > Integer.MAX_VALUE) {
                requestDecoder.setMaxCumulationBufferCapacity(Integer.MAX_VALUE);
            } else {
                requestDecoder.setMaxCumulationBufferCapacity((int) transport.maxCumulationBufferCapacity.bytes());
            }
        }
        if (transport.maxCompositeBufferComponents != -1) {
            requestDecoder.setMaxCumulationBufferComponents(transport.maxCompositeBufferComponents);
        }
        pipeline.addLast("decoder", requestDecoder);
        if (transport.compression) {
            pipeline.addLast("decoder_compress", new HttpContentDecompressor());
        }
View Full Code Here

  @Override
    public ChannelPipeline getPipeline() throws Exception {
    LOGGER.trace("Creating new pipeline");
    // Create a default pipeline implementation.
    ChannelPipeline pipeline = pipeline();
    pipeline.addLast("decoder", new HttpRequestDecoder());
    pipeline.addLast("aggregator", new HttpChunkAggregator(65536)); // eliminate the need to decode http chunks from the client
    pipeline.addLast("encoder", new HttpResponseEncoder());
    pipeline.addLast("chunkedWriter", new ChunkedWriteHandler());
    pipeline.addLast("handler", new RequestHandlerV2(group));
    return pipeline;
View Full Code Here

TOP

Related Classes of org.jboss.netty.handler.codec.http.HttpRequestDecoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.