HubAdminServer class

Session control over HTTP, on its own port.

A separate server rather than a path on the hub's own port, because the hub is meant to sit behind a reverse proxy: anything sharing that port is one proxy misconfiguration away from being public, whereas a second port that is never proxied — and by default bound to loopback — cannot be reached from outside the host at all. In the compose stack it is simply not published.

Endpoints, all requiring Authorization: Bearer <token>:

  • GET /status — session name, epoch, status, peer and connection counts
  • POST /end — end the session; everyone is disconnected
  • POST /open — reopen with a secret: {"secret": "...", "ttlSeconds": 0}
  • POST /revoke — bar one node: {"nodeUId": "..."}

Properties

hashCode → int
The hash code for this object.
no setterinherited
port → int
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → Future<void>
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

Static Methods

serve({required CoordinationHub hub, required String token, InternetAddress? address, int port = 0}) → Future<HubAdminServer>
Starts the admin server.