ocpp-rpc
    Preparing search index...

    Interface RPCClientOptions

    interface RPCClientOptions {
        backoff?: {
            factor?: number;
            initialDelay?: number;
            maxDelay?: number;
            randomisationFactor?: number;
        };
        callConcurrency?: number;
        callTimeoutMs?: number;
        deferPingsOnActivity?: boolean;
        endpoint: string;
        headers?: Record<string, string>;
        identity: string;
        maxBadMessages?: number;
        maxReconnects?: number;
        password?: string | Buffer<ArrayBufferLike>;
        pingIntervalMs?: number;
        protocols?: string[];
        query?: string | Record<string, string>;
        reconnect?: boolean;
        respondWithDetailedErrors?: boolean;
        strictMode?: boolean | string[];
        strictModeValidators?: Validator[];
        wsOpts?: ClientOptions;
    }
    Index
    backoff?: {
        factor?: number;
        initialDelay?: number;
        maxDelay?: number;
        randomisationFactor?: number;
    }

    If reconnect is true, specifies the options for an ExponentialStrategy backoff strategy.

    Type Declaration

    • Optionalfactor?: number

      Factor by which the delay increases after each attempt.

      2

    • OptionalinitialDelay?: number

      Initial delay in milliseconds before first reconnect attempt.

      1000

    • OptionalmaxDelay?: number

      Maximum delay in milliseconds between reconnect attempts.

      10000

    • OptionalrandomisationFactor?: number

      Randomisation factor to add jitter to reconnect delays.

      0.25

    callConcurrency?: number

    The number of concurrent in-flight outbound calls permitted at any one time. Additional calls are queued. There is no concurrency limit imposed on inbound calls. OCPP requires this to be set to 1, but you may choose other values for non-OCPP/custom protocols.

    1

    callTimeoutMs?: number

    Milliseconds to wait before unanswered outbound calls are rejected automatically.

    60000

    deferPingsOnActivity?: boolean

    Should the client skip sending keep-alive pings if other data is being regularly received? Enabling this option can help reduce data usage (especially on TLS-secured connections), but may cause compatibility issues with some real-world servers as they might treat an absence of pings to mean the connection to the client is lost.

    false

    endpoint: string

    The RPC server's endpoint (a websocket URL). Required.

    headers?: Record<string, string>

    Additional HTTP headers to send along with the websocket upgrade request. Must be specified in object form (e.g. {'X-Custom-Header': 'CustomValue'})

    {}

    identity: string

    The RPC client's identity. Will be automatically percent-encoded when used in the connection URL. Required.

    maxBadMessages?: number

    The maximum number of non-conforming RPC messages which can be tolerated before the client is automatically closed.

    Infinity

    maxReconnects?: number

    If reconnect is true, specifies the number of times to try reconnecting before failing and emitting a 'close' event.

    Infinity

    password?: string | Buffer<ArrayBufferLike>

    Optional password to use in HTTP Basic auth. This can be a Buffer to allow for binary passwords. If provided as a string, it will be encoded as UTF-8.

    pingIntervalMs?: number

    Milliseconds between WebSocket pings. Used for keep-alive timeouts.

    30000

    protocols?: string[]

    Array of subprotocols supported by this client.

    []

    query?: string | Record<string, string>

    An optional query string or object to append as the query string of the connection URL.

    ''

    reconnect?: boolean

    If true, the client will attempt to reconnect after losing connection to the RPCServer. Only applies after making one initial successful connection.

    true

    respondWithDetailedErrors?: boolean

    Specifies whether to send detailed errors (including stack trace) to remote party upon an error being thrown by a handler. This may be undesirable in a production environment as it leaks the call stack of the handler.

    false

    strictMode?: boolean | string[]

    Enable strict validation of calls & responses. Pass an array of subprotocol names to limit strict mode to specific protocols.

    false

    strictModeValidators?: Validator[]

    Optional additional validators to be used in conjunction with strictMode.

    []

    wsOpts?: ClientOptions

    Additional WebSocket options.

    {}