Alternative HTTP server
this feature is EXPERIMENTAL and might not work as expected.
If you encounter any bugs, please fill an issue, it will help us a lot :)
with the change of licence in Akka, we are experimenting around using Netty as http server for otoroshi (and getting rid of akka http)
in v1.5.14 we are introducing a new alternative http server base on reactor-netty. It also include a preview of an HTTP3 server using netty-incubator-codec-quic and netty-incubator-codec-http3
The specs
this new server can start during otoroshi boot sequence and accept HTTP/1.1 (with and without TLS), H2C and H2 (with and without TLS) connections and supporting both standard HTTP calls and websockets calls.
Enable the server
to enable the server, just turn on the following flag
otoroshi.next.experimental.netty-server.enabled = true
now you should see something like the following in the logs
...
root [info] otoroshi-experimental-netty-server -
root [info] otoroshi-experimental-netty-server - Starting the experimental Netty Server !!!
root [info] otoroshi-experimental-netty-server -
root [info] otoroshi-experimental-netty-server - https://0.0.0.0:10048 (HTTP/1.1, HTTP/2)
root [info] otoroshi-experimental-netty-server - http://0.0.0.0:10049 (HTTP/1.1, HTTP/2 H2C)
root [info] otoroshi-experimental-netty-server -
...
Server options
you can also setup the host and ports of the server using
otoroshi.next.experimental.netty-server.host = "0.0.0.0"
otoroshi.next.experimental.netty-server.http-port = 10049
otoroshi.next.experimental.netty-server.https-port = 10048
you can also enable access logs using
otoroshi.next.experimental.netty-server.accesslog = true
and enable wiretaping using
otoroshi.next.experimental.netty-server.wiretap = true
you can also custom number of worker thread using
otoroshi.next.experimental.netty-server.thread = 0 # system automatically assign the right number of threads
HTTP2
you can enable or disable HTTP2 with
otoroshi.next.experimental.netty-server.http2.enabled = true
otoroshi.next.experimental.netty-server.http2.h2c = true
HTTP3
you can enable or disable HTTP3 (preview ;) ) with
otoroshi.next.experimental.netty-server.http3.enabled = true
otoroshi.next.experimental.netty-server.http3.port = 10048 # yep can the the same as https because its on the UDP stack
the result will be something like
...
root [info] otoroshi-experimental-netty-server -
root [info] otoroshi-experimental-netty-server - Starting the experimental Netty Server !!!
root [info] otoroshi-experimental-netty-server -
root [info] otoroshi-experimental-netty-server - https://0.0.0.0:10048 (HTTP/3)
root [info] otoroshi-experimental-netty-server - https://0.0.0.0:10048 (HTTP/1.1, HTTP/2)
root [info] otoroshi-experimental-netty-server - http://0.0.0.0:10049 (HTTP/1.1, HTTP/2 H2C)
root [info] otoroshi-experimental-netty-server -
...
Native transport
It is possible to enable native transport for the server
otoroshi.next.experimental.netty-server.native.enabled = true
otoroshi.next.experimental.netty-server.native.driver = "Auto"
possible values for otoroshi.next.experimental.netty-server.native.driver are
Auto: the server try to find the best native option availableEpoll: the server uses Epoll native transport for Linux environmentsKQueue: the server uses KQueue native transport for MacOS environmentsIOUring: the server uses IOUring native transport for Linux environments that supports it (experimental, using netty-incubator-transport-io_uring)
the result will be something like when starting on a Mac
...
root [info] otoroshi-experimental-netty-server -
root [info] otoroshi-experimental-netty-server - Starting the experimental Netty Server !!!
root [info] otoroshi-experimental-netty-server -
root [info] otoroshi-experimental-netty-server - using KQueue native transport
root [info] otoroshi-experimental-netty-server -
root [info] otoroshi-experimental-netty-server - https://0.0.0.0:10048 (HTTP/3)
root [info] otoroshi-experimental-netty-server - https://0.0.0.0:10048 (HTTP/1.1, HTTP/2)
root [info] otoroshi-experimental-netty-server - http://0.0.0.0:10049 (HTTP/1.1, HTTP/2 H2C)
root [info] otoroshi-experimental-netty-server -
...
Env. variables
you can configure the server using the following env. variables
OTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_ENABLEDOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_NEW_ENGINE_ONLYOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HOSTOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP_PORTOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTPS_PORTOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_WIRETAPOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_ACCESSLOGOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_THREADSOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_PARSER_ALLOW_DUPLICATE_CONTENT_LENGTHSOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_PARSER_VALIDATE_HEADERSOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_PARSER_H_2_C_MAX_CONTENT_LENGTHOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_PARSER_INITIAL_BUFFER_SIZEOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_PARSER_MAX_HEADER_SIZEOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_PARSER_MAX_INITIAL_LINE_LENGTHOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_PARSER_MAX_CHUNK_SIZEOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP2_ENABLEDOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP2_H2COTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP3_ENABLEDOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP3_PORTOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP_3_INITIAL_MAX_STREAMS_BIDIRECTIONALOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP_3_INITIAL_MAX_STREAM_DATA_BIDIRECTIONAL_REMOTEOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP_3_INITIAL_MAX_STREAM_DATA_BIDIRECTIONAL_LOCALOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP_3_INITIAL_MAX_DATAOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP_3_MAX_RECV_UDP_PAYLOAD_SIZEOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP_3_MAX_SEND_UDP_PAYLOAD_SIZEOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_NATIVE_ENABLEDOTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_NATIVE_DRIVER