Skip to content

ServeTcpOptions

Defined in: src/launcher/serve-tcp.ts:62

Configuration for serveTcp.

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.


optional backlog?: number;

Defined in: src/launcher/serve-tcp.ts:93

Maximum listen backlog. Default: 128.


optional dispatchHook?: DispatchHook;

Defined in: src/launcher/serve-tcp.ts:87

Optional dispatch hook for observability.


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.


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.


optional identityResolutionTimeoutMs?: number;

Defined in: src/launcher/serve-tcp.ts:109

Total provider-resolution budget per accepted connection. Default: 1000 ms.


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).


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.


optional maximumProxyPreambleBytes?: number;

Defined in: src/launcher/serve-tcp.ts:119

Maximum complete PROXY v2 preamble size, including bounded unknown TLVs. Default: 536.


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).

Parameter Type
host string
port number

void


optional onServeStart?: ServeStartHook;

Defined in: src/launcher/serve-tcp.ts:91

Lifecycle hook fired once before the first dispatched request.


optional peerAuthenticationPolicy?: PeerAuthenticationPolicy;

Defined in: src/launcher/serve-tcp.ts:105

Combine connection evidence with anonymous application authentication.


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.


optional peerProviderConcurrency?: number;

Defined in: src/launcher/serve-tcp.ts:111

Maximum provider calls that may remain active after connection deadlines. Default: 64.


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).


optional protocolVersion?: string;

Defined in: src/launcher/serve-tcp.ts:77

Optional logical-service / protocol-contract version label.


optional proxyPreambleTimeoutMs?: number;

Defined in: src/launcher/serve-tcp.ts:117

Independent deadline for the complete PROXY v2 preamble. Default: 1000 ms.


optional proxyProtocolV2Required?: boolean;

Defined in: src/launcher/serve-tcp.ts:113

Require a PROXY protocol v2 preamble on every accepted connection. Default: false.


optional serverId?: string;

Defined in: src/launcher/serve-tcp.ts:79

Custom server identifier.


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.


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.