print("Check IP w/o proxyfying: ",requests.get('http://ip-api.com/json').content)
# Configure a default chain chain = [ 'socks5://localhost:7890/', 'http://testmidu-zone-adam:testmidu@43.153.102.235:6004'
] socks.setdefaultproxy()
for hop in chain: socks.adddefaultproxy(*socks.parseproxy(hop))
# Configure alternate routes (No proxy for localhost) socks.setproxy('localhost', socks.PROXY_TYPE_NONE) socks.setproxy('127.0.0.1', socks.PROXY_TYPE_NONE)
# Monkey Patching whole socket class (everything will be proxified) rawsocket = socket.socket socket.socket = socks.socksocket # Everything will be proxied!
print("Check IP After proxyfying: ",requests.get('http://ip-api.com/json').content)