GatekeeperServer class
The GatekeeperServer class represents a server that interacts with a Gatekeeper
instance to manage connections and access control. It listens for incoming connections
on a specified port and address, using an accessKey
for security authentication.
Example usage:
var gatekeeper = Gatekeeper(driver: gatekeeperDriver);
var server = GatekeeperServer(gatekeeper, accessKey: 'mySecretKeyOfLength32+', listenPort: 2243);
await server.start();
Constructors
- GatekeeperServer(Gatekeeper gatekeeper, {required String accessKey, required int listenPort, Object? address, int? loginErrorLimit, Duration? blockingTime, bool verbose = false})
- Creates a GatekeeperServer instance.
Properties
- accessKey → String
-
The access key required to authenticate connections. Minimal length: 32
final
- accessKeyHash ↔ Uint8List
-
latefinal
- address → Object
-
The address the server binds to. Defaults to InternetAddress.anyIPv4 if not specified.
final
- blockingTime → Duration
-
Defines the duration for which a remote address remains blocked
after exceeding the login error limit.
final
- gatekeeper → Gatekeeper
-
The Gatekeeper instance that the server uses for access control.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isStarted → bool
-
A flag indicating whether the server has started and is listening for connections.
no setter
- listenPort → int
-
The port the server listens on for incoming connections.
final
- loginErrorLimit → int
-
The maximum number of consecutive login errors allowed before
blocking the remote address.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- verbose → bool
-
final
Methods
-
close(
) → void - Closes the server and stops listening for new connections.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
start(
) → Future< bool> - Starts the server and begins listening for incoming connections.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
normalizeBlockingTime(
Duration? blockingTime) → Duration -
normalizeLoginErrorLimit(
int? loginErrorLimit) → int