My computer A has two networks, one connects to internet. The other one connects to computer B. How can I setup A to route all the internet traffic from B through a proxy running on A without setting B too much, possibly acting like a transparent proxy?
You can use A as gateway. Enable IP forwarding on machine A and configure it NAT outgoing traffic.
Configure addresses interfaces connecting A and B on (both hosts). Verify by pinging between both hosts using these addresses.
(also check there are no limiting rules in
Add NAT rules on host A (assuming
eth0connects to internet):
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Configure DNS on host B.