Class ServerConfig
java.lang.Object
io.github.mahmoudimus.quic.connection.ServerConfig
How a server accepts connections: its TLS configuration (certificates, possibly selected per SNI,
ALPN, session tickets and 0-RTT), the transport settings, Retry-based address validation, the
NEW_TOKEN tokens that let returning clients skip the Retry, the connection cap, whether clients
may migrate, and a preferred address. Immutable and shareable.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ServerConfig.BuilderA builder.intThe most connections the endpoint holds at once; further connection attempts are refused.booleanWhether clients may migrate to new addresses (RFC 9000 section 9).intHow many NEW_TOKEN tokens a connection sends the client after its handshake.The IPv4 preferred address (RFC 9000 section 9.6).The IPv6 preferred address (RFC 9000 section 9.6).booleanretry()Whether clients must prove their address with a Retry round trip before a connection is created (RFC 9000 section 8.1.2).tls()The TLS configuration.A builder that starts from this configuration, with the same token key.The transport settings of accepted connections.
-
Method Details
-
migration
public boolean migration()Whether clients may migrate to new addresses (RFC 9000 section 9).- Returns:
- false if the server sends
disable_active_migrationand drops packets from new addresses
-
preferredIpv4
The IPv4 preferred address (RFC 9000 section 9.6).- Returns:
- the address, or null
-
preferredIpv6
The IPv6 preferred address (RFC 9000 section 9.6).- Returns:
- the address, or null
-
toBuilder
A builder that starts from this configuration, with the same token key.- Returns:
- a new builder
-
newTokens
public int newTokens()How many NEW_TOKEN tokens a connection sends the client after its handshake.- Returns:
- the count
-
builder
A builder.- Parameters:
tls- the TLS configuration, with a certificate or certificate selector and ALPN- Returns:
- a new builder
-
tls
The TLS configuration.- Returns:
- the configuration
-
transport
The transport settings of accepted connections.- Returns:
- the settings
-
retry
public boolean retry()Whether clients must prove their address with a Retry round trip before a connection is created (RFC 9000 section 8.1.2).- Returns:
- true if Retry is on
-
maxConnections
public int maxConnections()The most connections the endpoint holds at once; further connection attempts are refused.- Returns:
- the cap
-