#[non_exhaustive]pub struct Tx3RelayConfig {
pub tx3_config: Tx3Config,
pub max_inbound_connections: u32,
pub max_control_streams: u32,
pub max_control_streams_per_ip: u32,
pub max_relays_per_control: u32,
pub connection_timeout_ms: u32,
}Expand description
A wrapper around Tx3Config with some additional parameters specific to configuring a relay server.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.tx3_config: Tx3ConfigThe standard tx3 configuration parameters.
max_inbound_connections: u32The maximum incoming connections that will be allowed. Any incoming connections beyond this limit will be dropped without response. The default value is 20480, which, while approaching as large as it can be, isn’t that large… if every user has the default max of 64 relays open, we can only support 320 users. It would be ideal to only use the following more specific limits, but we cannot know the stream type until reading from it, so we need this way to drop streams quicker immediately on accept().
max_control_streams: u32The maximum control streams we are willing to handle as a relay node. The default value is 320. 320 * 64 relays per control stream = 20480 which is approaching the max ephemeral port range on many systems (32768–60999 = 28231).
max_control_streams_per_ip: u32The maximum control streams we allow per remote ip address… Sorry folks behind campus or corporate NATs, this is the best we can do to at least require the effort of distributing a DDoS attack. But even with the small number of 4 here, it only takes 80 distributed nodes to lock down a relay server. The default value is 4.
max_relays_per_control: u32The maximum relay streams allowed for each relay client (identified by the control stream). Clients should close least recently used connections before the open count reaches this number, or any new incoming connections will be dropped before being reported to the control stream. The default value is 64.
connection_timeout_ms: u32This timeout is applied to two different types of incoming streams. First, it requires control stream TLS negotiation to complete in this time period. Second, it requires initiated streams to be matched and spliced to a target within this time frame. The default value is 20 seconds (1000 * 20).