Class HttpConnectionFactory

Namespace: redb.Route.Http
Assembly: redb.Route.Http.dll

Named connection factory for HTTP. Register it in the route registry and reference it by name
from the endpoint URI (connectionFactory=my-api) so Basic/Bearer credentials and the TLS
certificate password never have to appear in the URI, and therefore can never reach logs,
telemetry, or the Tsak dashboard.

Note: the request/listen address (host and port) is deliberately NOT part of this factory — for
the HTTP connector it comes from the endpoint path (http://0.0.0.0:5088/api) and stays
there, so a factory can never silently redirect a route to a different host.


Example:
context.AddToRegistry("billing-api", new HttpConnectionFactory
{
AuthScheme = HttpAuthScheme.Bearer,
AuthToken = Environment.GetEnvironmentVariable("BILLING_TOKEN")
});

// route carries no credentials at all:
r.To("http://billing.corp.local/invoices?connectionFactory=billing-api")

public sealed class HttpConnectionFactory

Inheritance

Object→HttpConnectionFactory

Properties

AuthScheme

Authentication scheme (None, Basic, Bearer).

public HttpAuthScheme AuthScheme { get; set; }

AuthToken

Bearer token for Bearer auth. Supports ${...} expressions exactly like the URI form

public string? AuthToken { get; set; }

Password

Password for Basic auth.

public string? Password { get; set; }

Ssl

Serve/connect over TLS.

public bool Ssl { get; set; }

SslCertPassword

Password for the TLS certificate.

public string? SslCertPassword { get; set; }

SslCertPath

Path to the TLS certificate.

public string? SslCertPath { get; set; }

Timeout

Request timeout in milliseconds (default 30000).

public int Timeout { get; set; }

Username

Username for Basic auth.

public string? Username { get; set; }