Class HttpConnectionFactory
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
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; }