Interface ConnectRouterOptions

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

Hierarchy

Properties

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.

addRoutes?: NameLike[]

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

connectTimeout?: number

Connect timeout (in milliseconds).

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

Type declaration

    • (face): Promise<unknown>
    • Parameters

      Returns Promise<unknown>

testConnectionTimeout?: number

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

Generated using TypeDoc