use of reactor.netty.tcp.TcpServer in project reactor-netty by reactor.
the class EchoServer method main.
public static void main(String[] args) throws Exception {
TcpServer server = TcpServer.create().port(PORT).wiretap(WIRETAP).handle((in, out) -> out.send(in.receive().retain()));
if (SECURE) {
SelfSignedCertificate ssc = new SelfSignedCertificate();
server = server.secure(spec -> spec.sslContext(TcpSslContextSpec.forServer(ssc.certificate(), ssc.privateKey())));
}
server.bindNow().onDispose().block();
}
Aggregations