RemoteOptions
Defined in: packages/sharding/src/remote.ts:17
Where, and how, a coordinator listens for hosts.
Properties
Section titled “Properties”allowInsecure?
Section titled “allowInsecure?”
optionalallowInsecure?:boolean
Defined in: packages/sharding/src/remote.ts:35
Listen on a non-loopback address without TLS: frames (shard messages and worker output) travel unencrypted and unsigned. Only for a network you fully trust, or when a TLS proxy in front terminates the connection. Default false.
clientAddress?
Section titled “clientAddress?”
optionalclientAddress?: (request,peer) =>string
Defined in: packages/sharding/src/remote.ts:72
The client address the per-address limits count by. Default: the peer address of the TCP connection. Behind a TLS proxy every peer is the proxy, so return the client address the proxy forwards (only from a header your proxy sets and overwrites).
Parameters
Section titled “Parameters”request
Section titled “request”Request
string | undefined
Returns
Section titled “Returns”string
connectionsPerSecond?
Section titled “connectionsPerSecond?”
optionalconnectionsPerSecond?:number
Defined in: packages/sharding/src/remote.ts:65
New connections one client address may open per second; more are refused. Default 10.
helloTimeout?
Section titled “helloTimeout?”
optionalhelloTimeout?:number
Defined in: packages/sharding/src/remote.ts:54
Milliseconds a new connection has to authenticate before it is closed. Default 3,000.
hostname?
Section titled “hostname?”
optionalhostname?:string
Defined in: packages/sharding/src/remote.ts:24
Interface to bind. Default 127.0.0.1, which only this machine can
reach. Any other address needs tls or allowInsecure.
hosts?
Section titled “hosts?”
optionalhosts?:string[]
Defined in: packages/sharding/src/remote.ts:41
The host IDs that make up the deployment. Clusters are placed on them in
this order, and an unlisted host is refused. Without it, the hosts that
have joined when spawn() starts are used, sorted by ID.
joinTimeout?
Section titled “joinTimeout?”
optionaljoinTimeout?:number
Defined in: packages/sharding/src/remote.ts:45
Milliseconds to wait for the hosts to join before spawn() fails. Default 60,000.
lease?
Section titled “lease?”
optionallease?:number
Defined in: packages/sharding/src/remote.ts:52
Fencing lease in milliseconds. A host that hears nothing from the coordinator for this long kills its workers; the coordinator waits twice as long before it treats the host as lost and restarts its clusters, so a shard never runs in two places. Default 15,000.
local?
Section titled “local?”
optionallocal?:boolean
Defined in: packages/sharding/src/remote.ts:74
Also run clusters on the coordinator’s own machine. Default false: clusters run on the hosts only.
maxUnauthenticated?
Section titled “maxUnauthenticated?”
optionalmaxUnauthenticated?:number
Defined in: packages/sharding/src/remote.ts:61
Most connections that may be waiting to authenticate at once. When full, the one that has waited longest is closed to make room: a host answers the challenge within a round trip, a connection that holds a slot idle does not. Default 16.
maxUnauthenticatedPerAddress?
Section titled “maxUnauthenticatedPerAddress?”
optionalmaxUnauthenticatedPerAddress?:number
Defined in: packages/sharding/src/remote.ts:63
The same limit for one client address (see clientAddress). Default 4.
minHosts?
Section titled “minHosts?”
optionalminHosts?:number
Defined in: packages/sharding/src/remote.ts:43
How many hosts must join before clusters are placed when hosts is not set. Default 1.
moveClusters?
Section titled “moveClusters?”
optionalmoveClusters?:boolean
Defined in: packages/sharding/src/remote.ts:82
When a host is lost, restart its clusters on the connected host (or
local) running the fewest, once the lost host has certainly fenced
itself (two leases after the coordinator dropped it). They stay there
when the host comes back. Default true; false restarts them on the
same host only, so they wait for it.
port:
number
Defined in: packages/sharding/src/remote.ts:19
TCP port. 0 picks a free one (read it from ClusterManager#remotePort).
secret
Section titled “secret”secret:
string
Defined in: packages/sharding/src/remote.ts:26
Shared secret, at least 16 characters. Hosts prove they know it; it never crosses the wire.
optionaltls?:object
Defined in: packages/sharding/src/remote.ts:28
TLS for wss://. Required to listen on a non-loopback address unless allowInsecure is set.
cert:
string
key:
string