Im using the following code to proxy my traffic within my Django application through a socks proxy,
def bind_proxy_port(enable=True):
try:
if enable == True:
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 8080)
socket.socket = socks.socksocket
return True
except:
raise Exception("unable to set proxy 127.0.0.1:8080")
The traffic im sending through this is HTTPS traffic. However this results in traffic to Rabbit-MQ to also be proxied which breaks the application. Is there a way to define only a single destination port to be proxied through and/or any other solution ?