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.
- 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?