The actual port the server is listening on. This is useful if you bound the server specifying 0 as port number signifying an ephemeral port
Like {@link HttpServer#close} but supplying a handler that will be called when the server is actually closed (or has failed).
Like {@link HttpServer#close} but supplying a handler that will be called when the server is actually closed (or has failed).
Set a connection handler for the server.
The handler will always be called on the event-loop thread.
Set an exception handler called for socket errors happening before the HTTP connection is established, e.g during the TLS handshake.
Set a handler
for handling invalid requests. When an invalid request is received by the server
this handler will be called with the request. The handler can send any HTTP response, when the response
ends, the server shall close the connection. {@link HttpServerRequest#decoderResult} can be used
to obtain the Netty decoder result and the failure cause reported by the decoder.
Currently this handler is only used for HTTP/1.x requests.
When no specific handler is set, the DEFAULT_INVALID_REQUEST_HANDLER is used.
Whether the metrics are enabled for this measured object
Like {@link HttpServer#listen} but supplying a handler that will be called when the server is actually listening (or has failed).
Like {@link HttpServer#listen} but supplying a handler that will be called when the server is actually listening (or has failed).
Tell the server to start listening on the given address supplying a handler that will be called when the server is actually listening (or has failed).
Tell the server to start listening on the given address supplying a handler that will be called when the server is actually listening (or has failed).
Like {@link HttpServer#listen} but supplying a handler that will be called when the server is actually listening (or has failed).
Like {@link HttpServer#listen} but supplying a handler that will be called when the server is actually listening (or has failed).
Like {@link HttpServer#listen} but supplying a handler that will be called when the server is actually listening (or has failed).
Like {@link HttpServer#listen} but supplying a handler that will be called when the server is actually listening (or has failed).
Set the request handler for the server to requestHandler
. As HTTP requests are received by the server,
instances of HttpServerRequest will be created and passed to this handler.
Return the request stream for the server. As HTTP requests are received by the server, instances of HttpServerRequest will be created and passed to the stream {@link ReadStream#handler}.
Like {@link HttpServer#updateSSLOptions} but supplying a handler that will be called when the update happened (or has failed).
Like {@link HttpServer#updateSSLOptions} but supplying a handler that will be called when the update happened (or has failed).
Set the WebSocket handler for the server to wsHandler
. If a WebSocket connect handshake is successful a
new ServerWebSocket instance will be created and passed to the handler.
Return the WebSocket stream for the server. If a WebSocket connect handshake is successful a new ServerWebSocket instance will be created and passed to the stream {@link ReadStream#handler}.
Generated using TypeDoc
An HTTP and WebSockets server.
You receive HTTP requests by providing a {@link HttpServer#requestHandler}. As requests arrive on the server the handler will be called with the requests.
You receive WebSockets by providing a {@link HttpServer#webSocketHandler}. As WebSocket connections arrive on the server, the WebSocket is passed to the handler.