open class HttpServer : Measured
An HTTP and WebSockets server.
You receive HTTP requests by providing a io.vertx.reactivex.core.http.HttpServer#requestHandler. As requests arrive on the server the handler will be called with the requests.
You receive WebSockets by providing a io.vertx.reactivex.core.http.HttpServer#websocketHandler. As WebSocket connections arrive on the server, the WebSocket is passed to the handler.
HttpServer(delegate: HttpServer) |
static val __TYPE_ARG: TypeArg<HttpServer> |
open fun actualPort(): Int
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 |
|
open fun close(): Unit
Close the server. Any open HTTP connections will be closed. The close happens asynchronously and the server may not be closed until some time after the call has returned. open fun close(completionHandler: Handler<AsyncResult<Void>>): Unit
Like |
|
open fun connectionHandler(handler: Handler<HttpConnection>): HttpServer
Set a connection handler for the server. |
|
open fun equals(other: Any?): Boolean |
|
open fun exceptionHandler(handler: Handler<Throwable>): HttpServer
Set an exception handler called for socket errors happening before the HTTP connection is established, e.g during the TLS handshake. |
|
open fun getDelegate(): HttpServer |
|
open fun hashCode(): Int |
|
open fun isMetricsEnabled(): Boolean
Whether the metrics are enabled for this measured object |
|
open fun listen(): HttpServer
Tell the server to start listening. The server will listen on the port and host specified in the io.vertx.core.http.HttpServerOptions that was used when creating the server. The listen happens asynchronously and the server may not be listening until some time after the call has returned. open fun listen(port: Int, host: String): HttpServer
Tell the server to start listening. The server will listen on the port and host specified here, ignoring any value set in the io.vertx.core.http.HttpServerOptions that was used when creating the server. The listen happens asynchronously and the server may not be listening until some time after the call has returned. open fun listen(port: Int, host: String, listenHandler: Handler<AsyncResult<HttpServer>>): HttpServeropen fun listen(port: Int, listenHandler: Handler<AsyncResult<HttpServer>>): HttpServeropen fun listen(listenHandler: Handler<AsyncResult<HttpServer>>): HttpServer
Like open fun listen(port: Int): HttpServer
Like |
|
open static fun newInstance(arg: HttpServer): HttpServer |
|
open fun requestHandler(handler: Handler<HttpServerRequest>): HttpServer
Set the request handler for the server to |
|
open fun requestStream(): ReadStream<HttpServerRequest>
Return the request stream for the server. As HTTP requests are received by the server, instances of io.vertx.reactivex.core.http.HttpServerRequest will be created and passed to the stream . |
|
open fun rxClose(): Completable
Like |
|
open fun rxListen(port: Int, host: String): Single<HttpServer>open fun rxListen(port: Int): Single<HttpServer>open fun rxListen(): Single<HttpServer>
Like |
|
open fun toString(): String |
|
open fun websocketHandler(handler: Handler<ServerWebSocket>): HttpServer
Set the websocket handler for the server to |
|
open fun websocketStream(): ReadStream<ServerWebSocket>
Return the websocket stream for the server. If a websocket connect handshake is successful a new io.vertx.reactivex.core.http.ServerWebSocket instance will be created and passed to the stream . |