Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: README update to highlight how to disable sending client identification #2913

Merged
merged 6 commits into from Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/wordlist.txt
Expand Up @@ -2,6 +2,7 @@ ACLs
autoload
autoloader
autoloading
analytics
Autoloading
backend
backends
Expand All @@ -13,6 +14,7 @@ customizable
Customizable
dataset
de
DisableIdentity
ElastiCache
extensibility
FPM
Expand Down Expand Up @@ -43,6 +45,7 @@ RocksDB
runtime
SHA
sharding
SETNAME
SSL
struct
stunnel
Expand Down
24 changes: 24 additions & 0 deletions README.md
Expand Up @@ -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!
Expand Down