Say I want to route all requests to google.com to localhost:333 , how to do so?
Shorewall routes. (FAQ)
You want to redirect all local google.com connection requests to a server running in your local zone at 127.0.0.1 and listening on port 333. Your local interface is eth1.
Disclaimer; I've not done exactly this with Shorewall, so modified an example Squid server setup:
If you just want to do this on a single machine, you can edit:
then restart network services
This would redirect normal web traffic to localhost:80 though.