/** * The host to which this server should bind. * * @param host The host to bind to. * * @return a new {@link TcpServer} */ public final TcpServer host(String host) { Objects.requireNonNull(host, "host"); return bootstrap(b -> TcpUtils.updateHost(b, host)); }
/** * The port to which this server should bind. * * @param port The port to bind to. * * @return a new {@link TcpServer} */ public final TcpServer port(int port) { return bootstrap(b -> TcpUtils.updatePort(b, port)); }
/** * Apply a wire logger configuration using {@link TcpServer} category * and {@code DEBUG} logger level * * @return a new {@link TcpServer} * @deprecated Use {@link TcpServer#wiretap(boolean)} */ @Deprecated public final TcpServer wiretap() { return bootstrap(b -> BootstrapHandlers.updateLogSupport(b, LOGGING_HANDLER)); }
@Override @SuppressWarnings("unchecked") public Mono<? extends DisposableServer> bind(TcpServer delegate) { return delegate.bootstrap(this) .bind() .map(CLEANUP_GLOBAL_RESOURCE); }
/** * The address to which this server should bind on subscribe. * * @param bindingAddressSupplier A supplier of the address to bind to. * * @return a new {@link TcpServer} */ public final TcpServer addressSupplier(Supplier<? extends SocketAddress> bindingAddressSupplier) { Objects.requireNonNull(bindingAddressSupplier, "bindingAddressSupplier"); return bootstrap(b -> b.localAddress(bindingAddressSupplier.get())); }
/** * Apply a wire logger configuration using {@link TcpServer} category * and {@code DEBUG} logger level * * @return a new {@link TcpServer} * @deprecated Use {@link TcpServer#wiretap(boolean)} */ @Deprecated public final TcpServer wiretap() { return bootstrap(b -> BootstrapHandlers.updateLogSupport(b, LOGGING_HANDLER)); }
@Override protected TcpServer tcpConfiguration() { return source.tcpConfiguration().bootstrap(this); }
/** * The host to which this server should bind. * * @param host The host to bind to. * * @return a new {@link TcpServer} */ public final TcpServer host(String host) { Objects.requireNonNull(host, "host"); return bootstrap(b -> TcpUtils.updateHost(b, host)); }
/** * The port to which this server should bind. * * @param port The port to bind to. * * @return a new {@link TcpServer} */ public final TcpServer port(int port) { return bootstrap(b -> TcpUtils.updatePort(b, port)); }
@Override protected TcpServer tcpConfiguration() { return source.tcpConfiguration().bootstrap(this); }
/** * The address to which this server should bind on subscribe. * * @param bindingAddressSupplier A supplier of the address to bind to. * * @return a new {@link TcpServer} */ public final TcpServer addressSupplier(Supplier<? extends SocketAddress> bindingAddressSupplier) { Objects.requireNonNull(bindingAddressSupplier, "bindingAddressSupplier"); return bootstrap(b -> b.localAddress(bindingAddressSupplier.get())); }
@Override @SuppressWarnings("unchecked") public Mono<? extends DisposableServer> bind(TcpServer delegate) { return delegate.bootstrap(this) .bind() .map(CLEANUP_GLOBAL_RESOURCE); }
@Override protected TcpServer tcpConfiguration() { return source.tcpConfiguration().bootstrap(this); }
/** * Apply a wire logger configuration using {@link HttpServer} category * and {@code DEBUG} logger level * * @return a new {@link HttpServer} * @deprecated Use {@link HttpServer#wiretap(boolean)} */ @Deprecated public final HttpServer wiretap() { return tcpConfiguration(tcpServer -> tcpServer.bootstrap(b -> BootstrapHandlers.updateLogSupport(b, LOGGING_HANDLER))); }
/** * Apply a wire logger configuration using {@link HttpServer} category * and {@code DEBUG} logger level * * @return a new {@link HttpServer} * @deprecated Use {@link HttpServer#wiretap(boolean)} */ @Deprecated public final HttpServer wiretap() { return tcpConfiguration(tcpServer -> tcpServer.bootstrap(b -> BootstrapHandlers.updateLogSupport(b, LOGGING_HANDLER))); }
/** * The HTTP protocol to support. Default is {@link HttpProtocol#HTTP11}. * * @param supportedProtocols The various {@link HttpProtocol} this server will support * * @return a new {@link HttpServer} */ public final HttpServer protocol(HttpProtocol... supportedProtocols) { return tcpConfiguration(tcpServer -> tcpServer.bootstrap(b -> HttpServerConfiguration.protocols(b, supportedProtocols))); }
/** * Build a {@link Function} that applies the http request decoder configuration to a * {@link TcpServer} by enriching its attributes. */ Function<TcpServer, TcpServer> build() { HttpRequestDecoderSpec decoder = new HttpRequestDecoderSpec(); decoder.initialBufferSize = initialBufferSize; decoder.maxChunkSize = maxChunkSize; decoder.maxHeaderSize = maxHeaderSize; decoder.maxInitialLineLength = maxInitialLineLength; decoder.validateHeaders = validateHeaders; return tcp -> tcp.bootstrap(b -> HttpServerConfiguration.decoder(b, decoder)); }
/** * Build a {@link Function} that applies the http request decoder configuration to a * {@link TcpServer} by enriching its attributes. */ Function<TcpServer, TcpServer> build() { HttpRequestDecoderSpec decoder = new HttpRequestDecoderSpec(); decoder.initialBufferSize = initialBufferSize; decoder.maxChunkSize = maxChunkSize; decoder.maxHeaderSize = maxHeaderSize; decoder.maxInitialLineLength = maxInitialLineLength; decoder.validateHeaders = validateHeaders; return tcp -> tcp.bootstrap(b -> HttpServerConfiguration.decoder(b, decoder)); }
/** * The HTTP protocol to support. Default is {@link HttpProtocol#HTTP11}. * * @param supportedProtocols The various {@link HttpProtocol} this server will support * * @return a new {@link HttpServer} */ public final HttpServer protocol(HttpProtocol... supportedProtocols) { return tcpConfiguration(tcpServer -> tcpServer.bootstrap(b -> HttpServerConfiguration.protocols(b, supportedProtocols))); }
/** * Configure the * {@link ServerCookieEncoder} and {@link ServerCookieDecoder} * * @param encoder the preferred ServerCookieEncoder * @param decoder the preferred ServerCookieDecoder * * @return a new {@link HttpServer} */ public final HttpServer cookieCodec(ServerCookieEncoder encoder, ServerCookieDecoder decoder) { return tcpConfiguration(tcp -> tcp.bootstrap( b -> HttpServerConfiguration.cookieCodec(b, encoder, decoder))); }