Struct jsonrpc_http_server::ServerBuilder [] [src]

pub struct ServerBuilder<M: Metadata = (), S: Middleware<M> = NoopMiddleware> { /* fields omitted */ }

Convenient JSON-RPC HTTP Server builder.

Methods

impl<M: Metadata, S: Middleware<M>> ServerBuilder<M, S>
[src]

Creates new ServerBuilder for given IoHandler.

If you want to re-use the same handler in couple places see with_remote function.

By default: 1. Server is not sending any CORS headers. 2. Server is validating Host header.

Utilize existing event loop remote to poll RPC results. Applies only to 1 of the threads. Other threads will spawn their own Event Loops.

Sets Enables or disables HTTP keep-alive. Default is true.

Sets number of threads of the server to run. Panics when set to 0.

Configures a list of allowed CORS origins.

Configures request middleware

Configures metadata extractor

Allow connections only with Host header set to binding address.

Specify a list of valid Host headers. Binding address is allowed automatically.

Start this JSON-RPC HTTP server trying to bind to specified SocketAddr.