ServerConfig class

Configuration for starting a DirectServer.

Constructors

ServerConfig({String host = '127.0.0.1', int port = 8080, String? authToken, int maxConnections = 100, List<String> corsOrigins = const ['*'], String? tlsCert, String? tlsKey, Duration idleTimeout = const Duration(minutes: 5)})
const

Properties

authToken → String?
Bearer token required for authenticated endpoints.
final
corsOrigins → List<String>
Allowed CORS origins. An empty list disables CORS headers.
final
hashCode → int
The hash code for this object.
no setterinherited
host → String
Hostname or IP to bind to.
final
idleTimeout → Duration
Duration after which an idle connection is closed.
final
maxConnections → int
Maximum concurrent connections.
final
port → int
TCP port to listen on.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tlsCert → String?
Path to a TLS certificate file (PEM).
final
tlsKey → String?
Path to a TLS private key file (PEM).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited