redis-py icon indicating copy to clipboard operation
redis-py copied to clipboard

Feature Request: add socks5 support for connecting via socks5 proxy

Open dmitryroshchin opened this issue 9 months ago • 0 comments

Version: 5.0.4

Platform: MacOS Monterey

Description: I've bumped into a problem while trying to use iredis which depends on redis-py to interact with elasticache cluster via ssh tunnel when only a single port on localhost can be used. Obvious solution was to use socks5 proxy behind the tunnel. The main obstacle is inability of the redis-py to connect via socks5 proxy.

Seems that adding it requires just a few lines of code

The patch above adds support for using sock5 proxy if variables REDIS_SOCKS5_PROXY_HOST and REDIS_SOCKS5_PROXY_PORT are set. Using of variables makes it work with minimal code changes.

The patch was tested on MacOS Monterey I believe the feature would be very useful for lots of people

Is there any chance of these changed to be accepted via PR?

dmitryroshchin avatar May 21 '24 16:05 dmitryroshchin