lexicons and xrpc
lexicon
com.fedproxy.temp.xrpc.tunnel
A TCP tunnel to a subscriber through the did:key ingress relay: a caller opens a WebSocket to /xrpc/com.fedproxy.temp.xrpc.tunnel on the subscriber's host (<did label>.<relay hostname>, or a custom-domain alias of it), and the subscriber connects it to its configured TCP target or in-process stream handler. The relay asks for no authentication on this route; it passes the caller's authorization and atproto-proxy headers to the subscriber in the #subscribe frame of com.fedproxy.temp.xrpc.subscribe, with nsid com.fedproxy.temp.xrpc.tunnel. Unlike the XRPC event-stream framing, there is no JSON or CBOR on this socket: every WebSocket message is a chunk of the TCP byte stream, as a #chunk. Each message the caller sends (binary, or text taken as its bytes) is written to the TCP connection; the subscriber reads the connection in chunks of up to 64 KiB and the caller gets each as one binary message. Bytes the caller sends before the subscriber's TCP connection is open are queued and written first. When the TCP connection ends the caller is closed with code 1000; when the subscriber cannot dial its target the caller is closed with code 1011 and the dial error; when the subscriber goes away, with code 4004 (subscriber disconnected). When the caller closes, the subscriber closes the TCP connection. A subscriber with no tunnel target answers nothing, so the socket stays open with no data.
definitions: #chunk
message
union #chunk
errors
| error | description |
|---|---|
NoSubscriber | No subscriber holds the host: sent as a WebSocket close with code 4004 (no active subscriber for subdomain <label>) right after the upgrade. |
#chunk object
One WebSocket message on the tunnel: raw bytes of the TCP stream, not a JSON object (it has no fields and no $type).
field: none.
used in
no page of these docs names it yet.
raw schema: lexicons/com/fedproxy/temp/xrpc/tunnel.json
{
"lexicon": 1,
"id": "com.fedproxy.temp.xrpc.tunnel",
"defs": {
"main": {
"type": "subscription",
"description": "A TCP tunnel to a subscriber through the did:key ingress relay: a caller opens a WebSocket to /xrpc/com.fedproxy.temp.xrpc.tunnel on the subscriber's host (<did label>.<relay hostname>, or a custom-domain alias of it), and the subscriber connects it to its configured TCP target or in-process stream handler. The relay asks for no authentication on this route; it passes the caller's authorization and atproto-proxy headers to the subscriber in the #subscribe frame of com.fedproxy.temp.xrpc.subscribe, with nsid com.fedproxy.temp.xrpc.tunnel. Unlike the XRPC event-stream framing, there is no JSON or CBOR on this socket: every WebSocket message is a chunk of the TCP byte stream, as a #chunk. Each message the caller sends (binary, or text taken as its bytes) is written to the TCP connection; the subscriber reads the connection in chunks of up to 64 KiB and the caller gets each as one binary message. Bytes the caller sends before the subscriber's TCP connection is open are queued and written first. When the TCP connection ends the caller is closed with code 1000; when the subscriber cannot dial its target the caller is closed with code 1011 and the dial error; when the subscriber goes away, with code 4004 (subscriber disconnected). When the caller closes, the subscriber closes the TCP connection. A subscriber with no tunnel target answers nothing, so the socket stays open with no data.",
"message": {
"schema": {
"type": "union",
"refs": [
"#chunk"
]
}
},
"errors": [
{
"name": "NoSubscriber",
"description": "No subscriber holds the host: sent as a WebSocket close with code 4004 (no active subscriber for subdomain <label>) right after the upgrade."
}
]
},
"chunk": {
"type": "object",
"description": "One WebSocket message on the tunnel: raw bytes of the TCP stream, not a JSON object (it has no fields and no $type).",
"properties": {}
}
}
}