Skip to content

procxy / PassableHandle

Type Alias: PassableHandle

ts
type PassableHandle = Socket | Server | Socket | number;

Defined in: src/types/procxy.ts:507

Union of OS-level handle types that can be transferred to the child process via $sendHandle.

Remarks

Handles are transferred, not cloned. Once sent, the parent process loses ownership: using the handle in the parent after calling $sendHandle() results in undefined behavior.

Supported types:

  • net.Socket — TCP or IPC stream socket
  • net.Server — TCP or IPC server (passes the listening descriptor)
  • dgram.Socket — UDP datagram socket
  • number — raw POSIX file descriptor (Unix only)

Platform notes:

  • Full support on Linux and macOS via SCM_RIGHTS (Unix domain socket ancillary data)
  • Limited support on Windows; net.Socket transfer works but dgram.Socket and raw fd do not

Handle passing requires supportHandles: true in ProcxyOptions andserialization: 'advanced'. A warning is logged when supportHandles: true is set on Windows.

See

Procxy — proxy type whose $sendHandle method accepts this type

Released under the MIT License.