Skip to content

ServeTcpOptions

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

Configuration for serveTcp.

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.


optional backlog?: number;

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

Maximum listen backlog. Default: 128.


optional dispatchHook?: DispatchHook;

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

Optional dispatch hook for observability.


optional enableDescribe?: boolean;

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

Enable describe method. Default: true.


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.


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


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

Parameter Type
host string
port number

void


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


optional protocolVersion?: string;

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

Optional logical-service / protocol-contract version label.


optional serverId?: string;

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

Custom server identifier.


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.