|
1 | 1 | # `createClient` configuration
|
2 | 2 |
|
3 |
| -| Property | Default | Description | |
4 |
| -|--------------------------|------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
5 |
| -| url | | `redis[s]://[[username][:password]@][host][:port][/db-number]` (see [`redis`](https://www.iana.org/assignments/uri-schemes/prov/redis) and [`rediss`](https://www.iana.org/assignments/uri-schemes/prov/rediss) IANA registration for more details) | |
6 |
| -| socket | | Socket connection properties. Unlisted [`net.connect`](https://nodejs.org/api/net.html#socketconnectoptions-connectlistener) properties (and [`tls.connect`](https://nodejs.org/api/tls.html#tlsconnectoptions-callback)) are also supported | |
7 |
| -| socket.port | `6379` | Redis server port | |
8 |
| -| socket.host | `'localhost'` | Redis server hostname | |
9 |
| -| socket.family | `0` | IP Stack version (one of `4 \| 6 \| 0`) | |
10 |
| -| socket.path | | Path to the UNIX Socket | |
11 |
| -| socket.connectTimeout | `5000` | Connection Timeout (in milliseconds) | |
12 |
| -| socket.noDelay | `true` | Toggle [`Nagle's algorithm`](https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay) | |
13 |
| -| socket.keepAlive | `5000` | Toggle [`keep-alive`](https://nodejs.org/api/net.html#net_socket_setkeepalive_enable_initialdelay) functionality | |
14 |
| -| socket.tls | | See explanation and examples [below](#TLS) | |
15 |
| -| socket.reconnectStrategy | `retries => Math.min(retries * 50, 500)` | A function containing the [Reconnect Strategy](#reconnect-strategy) logic | |
16 |
| -| username | | ACL username ([see ACL guide](https://redis.io/topics/acl)) | |
17 |
| -| password | | ACL password or the old "--requirepass" password | |
18 |
| -| name | | Client name ([see `CLIENT SETNAME`](https://redis.io/commands/client-setname)) | |
19 |
| -| database | | Redis database number (see [`SELECT`](https://redis.io/commands/select) command) | |
20 |
| -| modules | | Included [Redis Modules](../README.md#packages) | |
21 |
| -| scripts | | Script definitions (see [Lua Scripts](../README.md#lua-scripts)) | |
22 |
| -| functions | | Function definitions (see [Functions](../README.md#functions)) | |
23 |
| -| commandsQueueMaxLength | | Maximum length of the client's internal command queue | |
24 |
| -| disableOfflineQueue | `false` | Disables offline queuing, see [FAQ](./FAQ.md#what-happens-when-the-network-goes-down) | |
25 |
| -| readonly | `false` | Connect in [`READONLY`](https://redis.io/commands/readonly) mode | |
26 |
| -| legacyMode | `false` | Maintain some backwards compatibility (see the [Migration Guide](./v3-to-v4.md)) | |
27 |
| -| isolationPoolOptions | | See the [Isolated Execution Guide](./isolated-execution.md) | |
28 |
| -| pingInterval | | Send `PING` command at interval (in ms). Useful with ["Azure Cache for Redis"](https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/cache-best-practices-connection#idle-timeout) | |
| 3 | +| Property | Default | Description | |
| 4 | +|------------------------------|------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 5 | +| url | | `redis[s]://[[username][:password]@][host][:port][/db-number]` (see [`redis`](https://www.iana.org/assignments/uri-schemes/prov/redis) and [`rediss`](https://www.iana.org/assignments/uri-schemes/prov/rediss) IANA registration for more details) | |
| 6 | +| socket | | Socket connection properties. Unlisted [`net.connect`](https://nodejs.org/api/net.html#socketconnectoptions-connectlistener) properties (and [`tls.connect`](https://nodejs.org/api/tls.html#tlsconnectoptions-callback)) are also supported | |
| 7 | +| socket.port | `6379` | Redis server port | |
| 8 | +| socket.host | `'localhost'` | Redis server hostname | |
| 9 | +| socket.family | `0` | IP Stack version (one of `4 \| 6 \| 0`) | |
| 10 | +| socket.path | | Path to the UNIX Socket | |
| 11 | +| socket.connectTimeout | `5000` | Connection timeout (in milliseconds) | |
| 12 | +| socket.noDelay | `true` | Toggle [`Nagle's algorithm`](https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay) | |
| 13 | +| socket.keepAlive | `true` | Toggle [`keep-alive`](https://nodejs.org/api/net.html#socketsetkeepaliveenable-initialdelay) functionality | |
| 14 | +| socket.keepAliveInitialDelay | `5000` | If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket | |
| 15 | +| socket.tls | | See explanation and examples [below](#TLS) | |
| 16 | +| socket.reconnectStrategy | `retries => Math.min(retries * 50, 500)` | A function containing the [Reconnect Strategy](#reconnect-strategy) logic | |
| 17 | +| username | | ACL username ([see ACL guide](https://redis.io/topics/acl)) | |
| 18 | +| password | | ACL password or the old "--requirepass" password | |
| 19 | +| name | | Client name ([see `CLIENT SETNAME`](https://redis.io/commands/client-setname)) | |
| 20 | +| database | | Redis database number (see [`SELECT`](https://redis.io/commands/select) command) | |
| 21 | +| modules | | Included [Redis Modules](../README.md#packages) | |
| 22 | +| scripts | | Script definitions (see [Lua Scripts](../README.md#lua-scripts)) | |
| 23 | +| functions | | Function definitions (see [Functions](../README.md#functions)) | |
| 24 | +| commandsQueueMaxLength | | Maximum length of the client's internal command queue | |
| 25 | +| disableOfflineQueue | `false` | Disables offline queuing, see [FAQ](./FAQ.md#what-happens-when-the-network-goes-down) | |
| 26 | +| readonly | `false` | Connect in [`READONLY`](https://redis.io/commands/readonly) mode | |
| 27 | +| legacyMode | `false` | Maintain some backwards compatibility (see the [Migration Guide](./v3-to-v4.md)) | |
| 28 | +| isolationPoolOptions | | See the [Isolated Execution Guide](./isolated-execution.md) | |
| 29 | +| pingInterval | | Send `PING` command at interval (in ms). Useful with ["Azure Cache for Redis"](https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/cache-best-practices-connection#idle-timeout) | |
29 | 30 |
|
30 | 31 | ## Reconnect Strategy
|
31 | 32 |
|
|
0 commit comments