Skip to content

Instantly share code, notes, and snippets.

View Hanny2010's full-sized avatar

Hanny Huang Hanny2010

View GitHub Profile
@Hanny2010
Hanny2010 / redis_proxy_connection.py
Last active March 13, 2024 02:45
Connect to Redis server over Squid Proxy
import socket
from redis.client import Redis
from redis.connection import Connection, ConnectionPool
from redis._compat import iteritems
class ProxyConnection(Connection):
def __init__(self, host='localhost', port=6379, db=0, password=None,
socket_timeout=None, socket_connect_timeout=None,
socket_keepalive=False, socket_keepalive_options=None,