Function brane_prx::redirect::path_server_factory

source ·
pub async fn path_server_factory(
    context: &Arc<Context>,
    socket_addr: SocketAddr,
    remote_addr: String,
    tls: Option<NewPathRequestTlsOptions>,
) -> Result<impl Future<Output = Never>, Error>
Expand description

Initializes a path server with the given port and address.

§Arguments

  • context: The context that is used for the server.
  • socket_addr: The SocketAddress on which to serve.
  • remote_addr: The address to redirect the traffic to.
  • tls: If given, adds TLS encryption to the remote host with the given address.

§Returns

A Future implementing the path server.

§Errors

This function errors if we failed to bind a TCP server on the given port.