I have a very specific use-case at work where I have several external IP addresses (a full class C), and I need to select the outbound IP address I'm using.  The requests are http, and the application server is a different machine on the internal network.  For simplicity, I'd like to keep this as an http proxy so I don't have to change my application code.Requirements:Proxy looks for a header like External-Ip: x.y.z.a and sends traffic through the interface with that external IP address.  I am able to easily modify the header so if I need to send the interface name that's fine.If the header doesn't exist the proxy will pick a random one, and then return which interface it used as an http header.What's the easiest way to accomplish this?
Http proxy to select external interface based on host header
routing;proxy;http proxy
For what it's worth, Squid has this built in natively.  I used 'acl outbound0 req_header .2$' to set an ACL named 'outbound0' to the .2 external IP.  I generated the remaining ACLs with a script and just hardcoded them in the config file.Then, I combined it with tcp_outgoing_address, which chooses an external IP based on ACLs.  The result looks like:acl outbound0 req_header TS-Outbound-IP \.20$acl outbound1 req_header TS-Outbound-IP \.21$acl outbound2 req_header TS-Outbound-IP \.22$acl outbound3 req_header TS-Outbound-IP \.23$acl outbound4 req_header TS-Outbound-IP \.24$acl outbound5 req_header TS-Outbound-IP \.25$tcp_outgoing_address 192.168.1.20 outbound0tcp_outgoing_address 192.168.1.21 outbound1tcp_outgoing_address 192.168.1.22 outbound2tcp_outgoing_address 192.168.1.23 outbound3tcp_outgoing_address 192.168.1.24 outbound4tcp_outgoing_address 192.168.1.25 outbound5For now, this works perfectly for what we need.  I'll keep the question open because this method seems kludgy, and Im interested in alternatives.