Ports
TCP connections to ports on the host's loopback.
| Operation | Kind | HTTP |
|---|---|---|
ports.connect | stream | GET /v1/ports/{port} |
ports.connect
A TCP connection to a port on the host's loopback, 127.0.0.1. The port is dialled first, so one that nothing listens on is an error and not a stream.
Host level only. A stream, as a subscription on the portal or a WebSocket of its own. It does not resume. Through rookery serve it needs the role operate.
Arguments
| Name | Where | Required | Description |
|---|---|---|---|
port | path | yes | A TCP port on the host's loopback, 127.0.0.1: a number from 1 to 65535. |
Frames from the server
| Frame | Kind | Description |
|---|---|---|
bytes | binary | What the program on the port sent. |
eof | JSON | The program on the port closed its side. Bytes sent towards it still arrive. The stream ends once both sides have sent this. Example: {"eof":true} |
Frames to the server
| Frame | Kind | Description |
|---|---|---|
bytes | binary | Bytes for the program on the port. |
eof | JSON | The client sends no more, and the program on the port reads the end. What it sends still comes back. Example: {"eof":true} |
{
"id": 1,
"op": "ports.connect",
"args": {
"port": "VALUE"
}
}{
"id": 1,
"result": {
"open": true
}
}
{
"sub": 1,
"data": {
"eof": true
}
}
// binary: 00 00 00 01, then the bytesEnd the subscription with {"sub": 1, "end": true}.