I have a local HTTP proxy running, if I configure my browser to go through it works perfectly but I would need to leave the browser configuration blank and only redirect the traffic to the proxy with iptables (or any other mechanism).
I tried these rules (separately) without succeeding (proxy returns 400 bad request error):
iptables -t nat -A OUTPUT -p tcp -o lo -d 127.0.0.1 --dport 80 -j DNAT --to 127.0.0.1:8082
iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8082
Is it even possible to use an HTTP proxy with only iptables ? Or does the HTTP request has to be rewritten as well ?
Thanks in advance for your help
Best Answer
This is called "transparent proxy". You need two things to do it: