• Public
  • Public/Protected
  • All

Interface ConnectNetworkOptions




Optional H3Transport

H3Transport: typeof H3Transport

Enable HTTP/3 transport.

This is only relevant in browser environment.

This should be set to H3Transport class instance. It reduces browser bundle size in applications that do not use H3Transport.

Optional addRoutes

addRoutes: NameLike[]

Routes to be added on the created face. Default is ["/"].

Optional connectTimeout

connectTimeout: number

Connect timeout (in milliseconds).

Optional fallback

fallback: string[]

Fallback routers, used if FCH and default gateway are both unavailable.

Optional fastest

fastest: number

Number of faces to keep; others are closed. Faces are ranked by shortest testConnection duration. Default is 1.

Optional fch

fch: false | FchRequest

FCH request.

Default is requesting 4 routers. Pass false to disable FCH.

Optional fw

Optional mtu

mtu: number

Override MTU of datagram faces.

Optional preferH3

preferH3: boolean

Whether to try HTTP/3 before all other options. Default is false. Ignored if H3Transport is not enabled or supported.

Optional preferTcp

preferTcp: boolean

Use TCP instead of UDP.

This is only relevant in Node.js environment.

Optional testConnection

testConnection: false | TestConnectionPacket | TestConnectionPacket[] | ((face: FwFace) => Promise<unknown>)

Test face connection.

  • false: skip test.
  • string or Name or Interest or array: express Interest(s) and wait for any Data. If string ends with "/*", it's replaced with a random component.
  • function: execute the custom tester function.

Default is "/localhop/nfd/rib/list".

Optional testConnectionTimeout

testConnectionTimeout: number

InterestLifetime of connection test Interest packets. Used only if testConnection is a string or Name. Default is 2000.

Optional tryDefaultGateway

tryDefaultGateway: boolean

Consider default IPv4 gateway as a candidate.

Generated using TypeDoc