I have no idea what I'm doing and these (1, 2 ) don't seem to work for me. I need to force http(s) traffic to go through a proxy on my phone (WLAN 192.168.43.1:1234)
This sort of works:
iptables -t nat -A OUTPUT -d 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,127.0.0.1 -j ACCEPT
iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to 192.168.43.1:1234
iptables -t nat -A OUTPUT -p tcp --dport 443 -j DNAT --to 192.168.43.1:1234
In the log, I can see that the connection is happening and requests do reach the proxy, but the proxy throws error 65 and for some reason mentions refusing the connection to localhost:80. What did I do wrong?