Module server

Module server 

Source
Available on crate feature server only.
Expand description

A fully-fledged iroh-relay server over HTTP or HTTPS.

This module provides an API to run a full fledged iroh-relay server. It is primarily used by the iroh-relay binary in this crate. It can be used to run a relay server in other locations however.

This code is fully written in a form of structured-concurrency: every spawned task is always attached to a handle and when the handle is dropped the tasks abort. So tasks can not outlive their handle. It is also always possible to await for completion of a task. Some tasks additionally have a method to do graceful shutdown.

The relay server hosts the following services:

  • HTTPS /relay: The main URL endpoint to which clients connect and sends traffic over.
  • HTTPS /ping: Used for net_report probes.
  • HTTPS /generate_204: Used for net_report probes.

Re-exports§

pub use self::http_server::Handlers;
pub use self::http_server::RelayService;

Modules§

client
The server-side representation of an ongoing client relaying connection.
clients
The “Server” side of the client. Uses the ClientConnManager.
http_server
Low-level HTTP server components for embedding the relay service.
streams
Streams used in the server-side implementation of iroh relays.
testingtest-utils
Exposes functions to quickly configure a server suitable for testing.

Structs§

AcmeConfig
Configuration for the ACME client.
AllowAll
An AccessControl that admits every endpoint.
ClientRateLimit
Per-client rate limit configuration.
ClientRequest
Details about an incoming relay client connection.
ConnectionId
A process-unique identifier for a single relay client connection.
Limits
Rate limits.
Metrics
Metrics tracked for the relay server
OnDisconnectGuard
Reports a connection’s disconnect to AccessControl when dropped.
QuicConfig
Configuration for the QUIC server.
RelayConfig
Configuration for the Relay HTTP and HTTPS server.
RelayMetrics
All metrics tracked in the relay server.
Server
A running Relay + QAD server.
ServerConfig
Configuration for the full Relay.
TlsConfig
TLS configuration for Relay server.

Enums§

Access
Access restriction for an endpoint.
CertConfig
TLS certificate configuration.
SpawnError
Server spawn errors
SupervisorError
Server task errors

Constants§

DEFAULT_CERT_RELOAD_INTERVAL
The default certificate reload interval.

Traits§

AccessControl
Controls which endpoints may use the relay and observes their lifecycle.
DynAccessControl
A dyn-compatible version of AccessControl that returns boxed futures.

Functions§

reloading_resolver
Builds a [ResolvesServerCert] that reloads its certificate and key from disk on an interval.