Examples of HttpClientCodec


Examples of io.netty.handler.codec.http.HttpClientCodec

    }

    @Override
    public void configureNewPipeline(ChannelPipeline pipeline) {
        pipeline.addLast(HTTP_CODEC_HANDLER_NAME,
                         new HttpClientCodec(maxInitialLineLength, maxHeaderSize, maxChunkSize, failOnMissingResponse,
                                             validateHeaders));
    }
View Full Code Here

Examples of io.netty.handler.codec.http.HttpClientCodec

                subprotocol,
                allowExtensions,
                new DefaultHttpHeaders(),
                maxFramePayloadLength);
        WebSocketClientHandler handler = new WebSocketClientHandler(handshaker, maxFramePayloadLength, messageAggregation, eventsSubject);
        pipeline.addLast(new HttpClientCodec());
        pipeline.addLast(new HttpObjectAggregator(8192));
        pipeline.addLast(handler);
    }
View Full Code Here

Examples of io.netty.handler.codec.http.HttpClientCodec

     */
    public final ChannelFuture handshake(Channel channel, final ChannelPromise promise) {
        FullHttpRequest request =  newHandshakeRequest();
        HttpResponseDecoder decoder = channel.pipeline().get(HttpResponseDecoder.class);
        if (decoder == null) {
            HttpClientCodec codec = channel.pipeline().get(HttpClientCodec.class);
            if (codec == null) {
               promise.setFailure(new IllegalStateException("ChannelPipeline does not contain " +
                       "a HttpResponseDecoder or HttpClientCodec"));
               return promise;
            }
            codec.setSingleDecode(true);
        } else {
            decoder.setSingleDecode(true);
        }
        channel.write(request).addListener(new ChannelFutureListener() {
            @Override
View Full Code Here

Examples of io.netty.handler.codec.http.HttpClientCodec

             .channel(NioSocketChannel.class)
             .handler(new ChannelInitializer<SocketChannel>() {
                 @Override
                 public void initChannel(SocketChannel ch) throws Exception {
                     ChannelPipeline pipeline = ch.pipeline();
                     pipeline.addLast("http-codec", new HttpClientCodec());
                     pipeline.addLast("aggregator", new HttpObjectAggregator(8192));
                     pipeline.addLast("ws-handler", handler);
                 }
             });
View Full Code Here

Examples of io.netty.handler.codec.http.HttpClientCodec

            engine.setUseClientMode(true);

            p.addLast("ssl", new SslHandler(engine));
        }

        p.addLast("codec", new HttpClientCodec());

        // Remove the following line if you don't want automatic content decompression.
        p.addLast("inflater", new HttpContentDecompressor());

        // Uncomment the following line if you don't want to handle HttpChunks.
View Full Code Here

Examples of io.netty.handler.codec.http.HttpClientCodec

            SSLEngine engine = SecureChatSslContextFactory.getClientContext().createSSLEngine();
            engine.setUseClientMode(true);
            pipeline.addLast("ssl", new SslHandler(engine));
        }

        pipeline.addLast("codec", new HttpClientCodec());

        // Remove the following line if you don't want automatic content decompression.
        pipeline.addLast("inflater", new HttpContentDecompressor());

        // to be used since huge file transfer
View Full Code Here

Examples of io.netty.handler.codec.http.HttpClientCodec

            engine.setUseClientMode(true);

            pipeline.addLast("ssl", new SslHandler(engine));
        }

        pipeline.addLast("codec", new HttpClientCodec());

        // Remove the following line if you don't want automatic content decompression.
        pipeline.addLast("inflater", new HttpContentDecompressor());

        // Uncomment the following line if you don't want to handle HttpChunks.
View Full Code Here

Examples of io.netty.handler.codec.http.HttpClientCodec

            engine.setUseClientMode(true);

            pipeline.addLast("ssl", new SslHandler(engine));
        }

        pipeline.addLast("codec", new HttpClientCodec());

        // Remove the following line if you don't want automatic content decompression.
        pipeline.addLast("inflater", new HttpContentDecompressor());

        // to be used since huge file transfer
View Full Code Here

Examples of io.netty.handler.codec.http.HttpClientCodec

              ChannelPipeline pipeline = channel.pipeline();

              if (sslContext != null) {
                pipeline.addLast(sslContext.newHandler(channel.alloc()));
              }
              pipeline.addLast(new HttpClientCodec());
              pipeline.addLast(new HttpObjectAggregator(maxRequestSize));
            }
          });
      this.bootstrap = bootstrap;
    }
View Full Code Here

Examples of io.netty.handler.codec.http.HttpClientCodec

                     ChannelPipeline p = ch.pipeline();
                     if (sslCtx != null) {
                         p.addLast(sslCtx.newHandler(ch.alloc(), host, port));
                     }
                     p.addLast(
                             new HttpClientCodec(),
                             new HttpObjectAggregator(8192),
                             new WebSocketClientCompressionHandler(),
                             handler);
                 }
             });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.