HttpProtect.connect() method

Opens a Redis connection and adopts it as this instance's client.

Signature:

connect(options?: RedisOptions): Redis;

Parameters

Parameter

Type

Description

options

RedisOptions

(Optional) ioredis options; omitted means localhost:6379

Returns:

Redis

The newly created client, which is also stored on this instance.

Remarks

Called by the constructor when no client was supplied. Calling it again replaces the current client without disconnecting the old one, so a repeat call leaks a connection — use it to reconnect after HttpProtect.destroy(), not to reconfigure a live instance.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.