server.connections
List outbound connections to remote peers
CLI- Package
- @procedures/peer · README
- Path
["server","connections"]- CLI
mark server connections- As data
{"$proc":["server","connections"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/peer"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["server","connections"], {});
console.log(JSON.stringify(result));From the command line
$ mark server connections
As data, in a program
{ "$proc": ["server", "connections"], "input": {} }Input
The schema does not list fields (object).
Output
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connections | object[] | yes | The open connections |
JSON Schemas
{
"input": {
"type": "object",
"properties": {}
},
"output": {
"type": "object",
"properties": {
"connections": {
"type": "array",
"items": {
"type": "object",
"properties": {
"connectionId": {
"type": "string",
"description": "The id of the connection"
},
"remotePeerId": {
"type": "string",
"description": "The id of the remote peer"
},
"transport": {
"type": "string",
"description": "The transport of the connection"
},
"state": {
"type": "string",
"description": "The state: connecting, connected, disconnected or error"
},
"remoteProcedureCount": {
"type": "number",
"description": "The number of procedures of the remote peer"
},
"connectedAt": {
"description": "The time of the connection (ISO 8601)",
"type": "string"
}
},
"required": [
"connectionId",
"remotePeerId",
"transport",
"state",
"remoteProcedureCount"
],
"additionalProperties": {}
},
"description": "The open connections"
}
},
"required": [
"connections"
],
"additionalProperties": {}
}
}