From 12e5f0363ffa53a7ce2d7f5b4f56b5a762e7d888 Mon Sep 17 00:00:00 2001 From: Nicolas Favre-Felix Date: Wed, 9 Aug 2023 09:14:23 -0700 Subject: [PATCH] Add keep_alive_sec to both config files, document in README --- README.md | 1 + webdis.json | 3 +++ webdis.prod.json | 3 +++ 3 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 297c021..df99fb1 100644 --- a/README.md +++ b/README.md @@ -216,6 +216,7 @@ Follow this table to diagnose issues with SSL connections to Redis. * [WebSocket support](#websockets) (Currently using the specification from [RFC 6455](https://datatracker.ietf.org/doc/html/rfc6455)). * Connects to Redis using a TCP or UNIX socket. * Support for [secure connections to Redis](#configuring-webdis-with-ssl) (requires [Redis 6 or newer](https://redis.io/topics/encryption)). +* Support for "Keep-Alive" connections to Redis: add `"hiredis": { "keep_alive_sec": 15 }` to `webdis.json` to enable it with the default value. See the [Hiredis documentation](https://github.com/redis/hiredis#other-configuration-using-socket-options) for details, the value configured in `webdis.json` is the `interval` passed to `redisEnableKeepAliveWithInterval`. Important: note how it is used to set the value for `TCP_KEEPALIVE` (the same value) _and_ to compute the value for `TCP_KEEPINTVL` (integer, set to 1/3 × `interval`). * Restricted commands by IP range (CIDR subnet + mask) or HTTP Basic Auth, returning 403 errors. * Support for Redis authentication in the config file: set `redis_auth` to a single string to use a password value, or to an array of two strings to use username+password auth ([new in Redis 6.0](https://redis.io/commands/auth)). * Environment variables can be used as values in the config file, starting with `$` and in all caps (e.g. `$REDIS_HOST`). diff --git a/webdis.json b/webdis.json index 09d782c..f9c76d1 100644 --- a/webdis.json +++ b/webdis.json @@ -25,6 +25,9 @@ "enabled": ["DEBUG"] } ], + "hiredis": { + "keep_alive_sec": 15 + }, "verbosity": 4, "logfile": "webdis.log" diff --git a/webdis.prod.json b/webdis.prod.json index 8a95b31..7731ef3 100644 --- a/webdis.prod.json +++ b/webdis.prod.json @@ -22,6 +22,9 @@ "enabled": ["DEBUG"] } ], + "hiredis": { + "keep_alive_sec": 15 + }, "verbosity": 3, "logfile": "/var/log/webdis.log"