ServeTcpOptions
Defined in: src/launcher/serve-tcp.ts:53
Configuration for serveTcp.
Properties
Section titled “Properties”announcementSink?
Section titled “announcementSink?”optional announcementSink?: WritableStream;Defined in: src/launcher/serve-tcp.ts:87
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:80
Maximum listen backlog. Default: 128.
dispatchHook?
Section titled “dispatchHook?”optional dispatchHook?: DispatchHook;Defined in: src/launcher/serve-tcp.ts:74
Optional dispatch hook for observability.
enableDescribe?
Section titled “enableDescribe?”optional enableDescribe?: boolean;Defined in: src/launcher/serve-tcp.ts:72
Enable describe method. Default: true.
externalLocation?
Section titled “externalLocation?”optional externalLocation?: ExternalLocationConfig;Defined in: src/launcher/serve-tcp.ts:76
Optional external-storage config for large-batch externalisation.
optional host?: string;Defined in: src/launcher/serve-tcp.ts:56
Interface to bind. Defaults to 127.0.0.1 (loopback only). Binding a
routable address exposes the unauthenticated framing on the network.
idleTimeout?
Section titled “idleTimeout?”optional idleTimeout?: number;Defined in: src/launcher/serve-tcp.ts:62
Self-terminate after this many seconds with zero connected clients.
Default: 300. 0 disables the timer (server runs until killed).
onBound?
Section titled “onBound?”optional onBound?: (host, port) => void;Defined in: src/launcher/serve-tcp.ts:84
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:78
Lifecycle hook fired once before the first dispatched request.
optional port?: number;Defined in: src/launcher/serve-tcp.ts:59
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:68
Optional logical-service / protocol-contract version label.
serverId?
Section titled “serverId?”optional serverId?: string;Defined in: src/launcher/serve-tcp.ts:70
Custom server identifier.
startupGraceSeconds?
Section titled “startupGraceSeconds?”optional startupGraceSeconds?: number;Defined in: src/launcher/serve-tcp.ts:66
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.
