GatekeeperServer constructor
GatekeeperServer(})
Creates a GatekeeperServer instance.
gatekeeper: the Gatekeeper instance.accessKey: the access key for login.listenPort: the port to listen for connections. NO default port for security purpose.address: Optional addresses to bind. See ServerSocket.bind. Default: InternetAddress.anyIPv4loginErrorLimit: The limit of login errors to block a Socket. Default: 3 ; Minimal: 3blockingTime: The Socket blocking time. Default: 10min
Implementation
GatekeeperServer(this.gatekeeper,
{required this.accessKey,
required this.listenPort,
Object? address,
int? loginErrorLimit,
Duration? blockingTime,
this.verbose = false})
: address = address ?? InternetAddress.anyIPv4,
loginErrorLimit = normalizeLoginErrorLimit(loginErrorLimit),
blockingTime = normalizeBlockingTime(blockingTime) {
if (accessKey.length < 32) {
throw ArgumentError(
"Invalid `accessKey` length: ${accessKey.length} < 32");
}
accessKeyHash = hashAccessKey(accessKey);
}