Does anybody know a quick way to force an outgoing http request to go through a specific (logical) ip address, in java?
I'm thinking of using Apache HTTP client (part of http components), which surely enough has a way to do it, but the API looks not trivial. Has anybody already performed anything similar with it?
Thank you.
Does this help?
How to make the JVM use a given source IP by default?
use socket.bind(bindpoint) just before socket.connect(endpoint).
bindpoint and endpoint can be InetSocketAddress
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With