ServeTcpOptions
Defined in: src/launcher/serve-tcp.ts:62
Configuration for serveTcp.
Properties
Section titled “Properties”announcementSink?
Section titled “announcementSink?”optional announcementSink?: WritableStream;Defined in: src/launcher/serve-tcp.ts:100
Override the stream used for the TCP:<host>:<port> line. Defaults to
process.stdout.
backlog?
Section titled “backlog?”optional backlog?: number;Defined in: src/launcher/serve-tcp.ts:93
Maximum listen backlog. Default: 128.
dispatchHook?
Section titled “dispatchHook?”optional dispatchHook?: DispatchHook;Defined in: src/launcher/serve-tcp.ts:87
Optional dispatch hook for observability.
enableDescribe?
Section titled “enableDescribe?”optional enableDescribe?: boolean;Defined in: src/launcher/serve-tcp.ts:85
Host vgi_rpc.Reflection.v1. Default: true.
Named for the __describe__ method it used to switch on. What it gates
is introspection, which is now a co-hosted protocol rather than a
reserved method answered before dispatch.
externalLocation?
Section titled “externalLocation?”optional externalLocation?: ExternalLocationConfig;Defined in: src/launcher/serve-tcp.ts:89
Optional external-storage config for large-batch externalisation.
optional host?: string;Defined in: src/launcher/serve-tcp.ts:65
Interface to bind. Defaults to 127.0.0.1 (loopback only). Binding a
routable address exposes the unauthenticated framing on the network.
identityResolutionTimeoutMs?
Section titled “identityResolutionTimeoutMs?”optional identityResolutionTimeoutMs?: number;Defined in: src/launcher/serve-tcp.ts:109
Total provider-resolution budget per accepted connection. Default: 1000 ms.
idleTimeout?
Section titled “idleTimeout?”optional idleTimeout?: number;Defined in: src/launcher/serve-tcp.ts:71
Self-terminate after this many seconds with zero connected clients.
Default: 300. 0 disables the timer (server runs until killed).
irohProxyIssuer?
Section titled “irohProxyIssuer?”optional irohProxyIssuer?: string;Defined in: src/launcher/serve-tcp.ts:122
Locally configured issuer enabling the fixed Iroh EndpointId TLV on trusted PROXY/UNSPEC connections.
maximumProxyPreambleBytes?
Section titled “maximumProxyPreambleBytes?”optional maximumProxyPreambleBytes?: number;Defined in: src/launcher/serve-tcp.ts:119
Maximum complete PROXY v2 preamble size, including bounded unknown TLVs. Default: 536.
onBound?
Section titled “onBound?”optional onBound?: (host, port) => void;Defined in: src/launcher/serve-tcp.ts:97
Called after listen() returns successfully but before
TCP:<host>:<port> is printed. Invoked with the bound host and the
actual bound port (resolved when port=0).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
host |
string |
port |
number |
Returns
Section titled “Returns”void
onServeStart?
Section titled “onServeStart?”optional onServeStart?: ServeStartHook;Defined in: src/launcher/serve-tcp.ts:91
Lifecycle hook fired once before the first dispatched request.
peerAuthenticationPolicy?
Section titled “peerAuthenticationPolicy?”optional peerAuthenticationPolicy?: PeerAuthenticationPolicy;Defined in: src/launcher/serve-tcp.ts:105
Combine connection evidence with anonymous application authentication.
peerIdentityProviders?
Section titled “peerIdentityProviders?”optional peerIdentityProviders?: readonly PeerIdentityProvider[];Defined in: src/launcher/serve-tcp.ts:103
Resolve peer identity once per accepted connection. Evidence is snapshotted for the connection lifetime and never read from VGI request bytes.
peerProviderConcurrency?
Section titled “peerProviderConcurrency?”optional peerProviderConcurrency?: number;Defined in: src/launcher/serve-tcp.ts:111
Maximum provider calls that may remain active after connection deadlines. Default: 64.
peerServiceName?
Section titled “peerServiceName?”optional peerServiceName?: string;Defined in: src/launcher/serve-tcp.ts:107
Logical service destination supplied to destination-aware providers.
optional port?: number;Defined in: src/launcher/serve-tcp.ts:68
TCP port to bind. Defaults to 0, which lets the OS pick a free port
(reported via the TCP:<host>:<port> line and onBound).
protocolVersion?
Section titled “protocolVersion?”optional protocolVersion?: string;Defined in: src/launcher/serve-tcp.ts:77
Optional logical-service / protocol-contract version label.
proxyPreambleTimeoutMs?
Section titled “proxyPreambleTimeoutMs?”optional proxyPreambleTimeoutMs?: number;Defined in: src/launcher/serve-tcp.ts:117
Independent deadline for the complete PROXY v2 preamble. Default: 1000 ms.
proxyProtocolV2Required?
Section titled “proxyProtocolV2Required?”optional proxyProtocolV2Required?: boolean;Defined in: src/launcher/serve-tcp.ts:113
Require a PROXY protocol v2 preamble on every accepted connection. Default: false.
serverId?
Section titled “serverId?”optional serverId?: string;Defined in: src/launcher/serve-tcp.ts:79
Custom server identifier.
startupGraceSeconds?
Section titled “startupGraceSeconds?”optional startupGraceSeconds?: number;Defined in: src/launcher/serve-tcp.ts:75
Grace period after listen() succeeds before the idle timer starts
ticking. Default: 5 — gives the first launcher caller a chance to
connect after the TCP:<host>:<port> announcement.
trustedProxyAddresses?
Section titled “trustedProxyAddresses?”optional trustedProxyAddresses?: readonly string[];Defined in: src/launcher/serve-tcp.ts:115
Exact IPv4/IPv6 addresses allowed to send PROXY v2. CIDRs and hostnames are rejected.
