Assuming you don’t know yours $client_ip, you can do the following:
- Set a unique name for your connection with Redis with
CLIENT SETNAME - Get customer list with
CLIENT LIST - Find the line with the name of the connection and extract the IP address.
- Use the resulting IP address in your team
SET
Example
127.0.0.1:6379> client getname
(nil)
127.0.0.1:6379> client setname FreddyFrog
OK
127.0.0.1:6379> client getname
"FreddyFrog"
127.0.0.1:6379> client list
id=4 addr=127.0.0.1:49426 fd=6 name=FreddyFrog age=25 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client
source
share