Class ServerResolver
Resolve server names to addresses: IP literals and names with a port directly, otherwise through /.well-known/matrix/server delegation, then SRV records (_matrix-fed._tcp, and the older _matrix._tcp), else port 8448.
Inherited Members
Namespace: Uniform.Matrix.Server.Federation
Assembly: Uniform.Matrix.Server.dll
Syntax
public sealed class ServerResolver
Remarks
With an SRV record, the connection goes to the record's target while the Host header, and with it the name the TLS certificate must be valid for, stays the server name. Results are cached for a day when delegation was found, an hour when not.
Constructors
| Edit this page View SourceServerResolver(IHttpClientFactory, SrvLookup, TimeProvider, ILogger<ServerResolver>)
Create the resolver.
Declaration
public ServerResolver(IHttpClientFactory httpClients, SrvLookup srv, TimeProvider time, ILogger<ServerResolver> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| IHttpClientFactory | httpClients | |
| SrvLookup | srv | |
| TimeProvider | time | |
| ILogger<ServerResolver> | logger |
Methods
| Edit this page View SourceResolveAsync(string, CancellationToken)
Return where to reach serverName; throw M_INVALID_PARAM for invalid names.
Declaration
public Task<ServerAddress> ResolveAsync(string serverName, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | serverName | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<ServerAddress> |