use of reactor.netty.DisposableServer in project reactor-netty by reactor.
the class Application method main.
public static void main(String[] args) {
DisposableServer server = HttpServer.create().accessLog(true).bindNow();
server.onDispose().block();
}
use of reactor.netty.DisposableServer in project reactor-netty by reactor.
the class CustomFormatAndFilterAccessLogApplication method main.
public static void main(String[] args) {
DisposableServer server = HttpServer.create().accessLog(true, // <1>
AccessLogFactory.createFilter(// <1>
p -> !String.valueOf(p.uri()).startsWith("/health/"), // <2>
x -> AccessLog.create("method={}, uri={}", x.method(), x.uri()))).bindNow();
server.onDispose().block();
}
use of reactor.netty.DisposableServer in project reactor-netty by reactor.
the class FilterLogAccessApplication method main.
public static void main(String[] args) {
DisposableServer server = HttpServer.create().accessLog(true, AccessLogFactory.createFilter(p -> !String.valueOf(p.uri()).startsWith("/health/"))).bindNow();
server.onDispose().block();
}
use of reactor.netty.DisposableServer in project reactor-netty by reactor.
the class MultiAddressApplication method main.
public static void main(String[] args) {
HttpServer httpServer = HttpServer.create();
DisposableServer server1 = httpServer.host(// <1>
"localhost").port(// <2>
8080).bindNow();
DisposableServer server2 = httpServer.host(// <3>
"0.0.0.0").port(// <4>
8081).bindNow();
Mono.when(server1.onDispose(), server2.onDispose()).block();
}
use of reactor.netty.DisposableServer in project reactor-netty by reactor.
the class Application method main.
public static void main(String[] args) {
DisposableServer server = HttpServer.create().forwarded(// <1>
true).route(routes -> routes.get("/clientip", (request, response) -> response.sendString(Mono.just(// <2>
request.remoteAddress().getHostString())))).bindNow();
server.onDispose().block();
}
Aggregations