private void addHttpHandlers(ChannelHandlerContext ctx) { final Channel ch = ctx.channel(); final ChannelPipeline p = ctx.pipeline(); final Http1ObjectEncoder writer = new Http1ObjectEncoder(ch, true, true); p.addLast(new HttpServerCodec( config.http1MaxInitialLineLength(), config.http1MaxHeaderSize(), config.http1MaxChunkSize())); p.addLast(new Http1RequestDecoder(config, ch, SCHEME_HTTPS, writer)); configureIdleTimeoutHandler(p); p.addLast(new HttpServerHandler(config, gracefulShutdownSupport, writer, SessionProtocol.H1, proxiedAddresses)); }
private void configureHttp1WithUpgrade(ChannelHandlerContext ctx) { final ChannelPipeline p = ctx.pipeline(); final HttpServerCodec http1codec = new HttpServerCodec( config.http1MaxInitialLineLength(), config.http1MaxHeaderSize(), config.http1MaxChunkSize()); String baseName = name; assert baseName != null; baseName = addAfter(p, baseName, http1codec); baseName = addAfter(p, baseName, new HttpServerUpgradeHandler( http1codec, protocol -> { if (!AsciiString.contentEquals(Http2CodecUtil.HTTP_UPGRADE_PROTOCOL_NAME, protocol)) { return null; } return new Http2ServerUpgradeCodec( newHttp2ConnectionHandler(p)); }, UPGRADE_REQUEST_MAX_LENGTH)); addAfter(p, baseName, new Http1RequestDecoder(config, ctx.channel(), SCHEME_HTTP, responseEncoder)); }
@Override public String toString() { String strVal = this.strVal; if (strVal == null) { this.strVal = strVal = toString( getClass(), ports(), null, virtualHosts(), workerGroup(), shutdownWorkerGroupOnStop(), maxNumConnections(), idleTimeoutMillis(), defaultRequestTimeoutMillis(), defaultMaxRequestLength(), verboseResponses(), http2InitialConnectionWindowSize(), http2InitialStreamWindowSize(), http2MaxStreamsPerConnection(), http2MaxFrameSize(), http2MaxHeaderListSize(), http1MaxInitialLineLength(), http1MaxHeaderSize(), http1MaxChunkSize(), proxyProtocolMaxTlvSize(), gracefulShutdownQuietPeriod(), gracefulShutdownTimeout(), blockingTaskExecutor(), meterRegistry(), serviceLoggerPrefix(), accessLogWriter(), shutdownAccessLogWriterOnStop(), channelOptions(), childChannelOptions(), clientAddressSources(), clientAddressTrustedProxyFilter(), clientAddressFilter() ); } return strVal; }