From 99527f0ac1e50d37fd25692b9484cba84c52f611 Mon Sep 17 00:00:00 2001 From: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> Date: Tue, 20 Feb 2024 16:37:22 +0200 Subject: [PATCH] docs: README update to highlight how to disable sending client identification (#2913) --- .github/wordlist.txt | 3 +++ README.md | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/.github/wordlist.txt b/.github/wordlist.txt index 48d3fc48..52fdc1bc 100644 --- a/.github/wordlist.txt +++ b/.github/wordlist.txt @@ -2,6 +2,7 @@ ACLs autoload autoloader autoloading +analytics Autoloading backend backends @@ -13,6 +14,7 @@ customizable Customizable dataset de +DisableIdentity ElastiCache extensibility FPM @@ -43,6 +45,7 @@ RocksDB runtime SHA sharding +SETNAME SSL struct stunnel diff --git a/README.md b/README.md index 7ba24268..043d3f0e 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,30 @@ func ExampleClient() *redis.Client { ``` + +### Advanced Configuration + +go-redis supports extending the client identification phase to allow projects to send their own custom client identification. + +#### Default Client Identification + +By default, go-redis automatically sends the client library name and version during the connection process. This feature is available in redis-server as of version 7.2. As a result, the command is "fire and forget", meaning it should fail silently, in the case that the redis server does not support this feature. + +#### Disabling Identity Verification + +When connection identity verification is not required or needs to be explicitly disabled, a `DisableIndentity` configuration option exists. In V10 of this library, `DisableIndentity` will become `DisableIdentity` in order to fix the associated typo. + +To disable verification, set the `DisableIndentity` option to `true` in the Redis client options: + +```go +rdb := redis.NewClient(&redis.Options{ + Addr: "localhost:6379", + Password: "", + DB: 0, + DisableIndentity: true, // Disable set-info on connect +}) +``` + ## Contributing Please see [out contributing guidelines](CONTRIBUTING.md) to help us improve this library!