Interface ConnectRouterOptions

connectToRouter options.

interface ConnectRouterOptions {
    addRoutes?: NameLike[];
    connectTimeout?: number;
    fw?: Forwarder;
    H3Transport?: typeof H3Transport;
    mtu?: number;
    preferTcp?: boolean;
    testConnection?:
        | false
        | TestConnectionPacket
        | TestConnectionPacket[]
        | ((face: FwFace) => Promise<unknown>);
    testConnectionTimeout?: number;
}

Hierarchy (view full)

Properties

addRoutes?: NameLike[]

Routes to be added on the created face.

["/"]

connectTimeout?: number

Connect timeout (in milliseconds).

Logical forwarder to attach faces to.

Forwarder.getDefault()

H3Transport?: typeof H3Transport

Enable HTTP/3 transport.

This is only relevant in browser environment.

This should be set to H3Transport class instance. Having this option avoids always pulling in H3Transport code, to reduce browser bundle size in applications that do not use it.

mtu?: number

Override MTU of datagram faces.

preferTcp?: boolean

Use TCP instead of UDP.

This is only relevant in Node.js environment.

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

Test face connection.

"/localhop/nfd/rib/list"

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

InterestLifetime of connection test Interest packets.

2000

Used only if testConnection is a string or Name.