Skip to content

Connections

Manage p2p connections, relay servers, and host configuration.

Connections

connection.list (void): Connection[]

List active p2p connections. The connections signal fires when connections change.

typescript
const connections = await app.request('connection.list', []);

connection.pool (void): PoolEntry[]

Show all connections including in-progress ones.

connection.check (void): bool

Trigger connection attempts to all known peers (DHT lookup, relay, direct).

connection.disconnect (id: number): bool

Close a specific connection by ID.

connection.disconnectAll (): bool

Close all connections.

connection.apps (host: Host): App[]

List apps running on a connected remote host.

Relay

Relay servers provide NAT traversal when direct connections fail.

relay.list (void): Relay[]

List configured relay servers.

relay.add (relay: string): bool

Add a relay server.

relay.remove (relay: string): bool

Remove a relay server.

Host

host.get (void): { hid, name? }

Get this host's ID and display name.

host.setName (name: string): { success }

Set this host's display name. Used in peer notation — e.g., André@hp.

host.config

Get or set host configuration.

host.skipConnectionAcl (bool): string

Skip connection ACL checks. Development use only.