Search in sources :

Example 1 with FlashPolicyHandler

use of io.vertx.core.http.impl.cgbystrom.FlashPolicyHandler in project vert.x by eclipse.

the class HttpServerImpl method configureHttp1.

private void configureHttp1(ChannelPipeline pipeline) {
    if (logEnabled) {
        pipeline.addLast("logging", new LoggingHandler());
    }
    if (USE_FLASH_POLICY_HANDLER) {
        pipeline.addLast("flashpolicy", new FlashPolicyHandler());
    }
    pipeline.addLast("httpDecoder", new HttpRequestDecoder(options.getMaxInitialLineLength(), options.getMaxHeaderSize(), options.getMaxChunkSize(), false));
    pipeline.addLast("httpEncoder", new VertxHttpResponseEncoder());
    if (options.isDecompressionSupported()) {
        pipeline.addLast("inflater", new HttpContentDecompressor(true));
    }
    if (options.isCompressionSupported()) {
        pipeline.addLast("deflater", new HttpChunkContentCompressor(options.getCompressionLevel()));
    }
    if (sslHelper.isSSL() || options.isCompressionSupported()) {
        // only add ChunkedWriteHandler when SSL is enabled otherwise it is not needed as FileRegion is used.
        // For large file / sendfile support
        pipeline.addLast("chunkedWriter", new ChunkedWriteHandler());
    }
    if (options.getIdleTimeout() > 0) {
        pipeline.addLast("idle", new IdleStateHandler(0, 0, options.getIdleTimeout()));
    }
    pipeline.addLast("handler", new ServerHandler(pipeline.channel()));
}
Also used : FlashPolicyHandler(io.vertx.core.http.impl.cgbystrom.FlashPolicyHandler) LoggingHandler(io.netty.handler.logging.LoggingHandler) ChunkedWriteHandler(io.netty.handler.stream.ChunkedWriteHandler) HttpRequestDecoder(io.netty.handler.codec.http.HttpRequestDecoder) IdleStateHandler(io.netty.handler.timeout.IdleStateHandler) HttpContentDecompressor(io.netty.handler.codec.http.HttpContentDecompressor)

Aggregations

HttpContentDecompressor (io.netty.handler.codec.http.HttpContentDecompressor)1 HttpRequestDecoder (io.netty.handler.codec.http.HttpRequestDecoder)1 LoggingHandler (io.netty.handler.logging.LoggingHandler)1 ChunkedWriteHandler (io.netty.handler.stream.ChunkedWriteHandler)1 IdleStateHandler (io.netty.handler.timeout.IdleStateHandler)1 FlashPolicyHandler (io.vertx.core.http.impl.cgbystrom.FlashPolicyHandler)1