I have a Java application running on my server, which send's request to external servers.
My server has 5 different IP Addresses.
how can i make each request with one different IP Address?
As instance, i want to send first request with 192.168.1.2 and send second request with 192.168.1.3 and so on.
In PHP i reached this purpose with this code
curl_setopt_array($curl , array(CURLOPT_INTERFACE => 'IpAddress'));
I searched for Unirest and OKHttp, but i couldn't find any good soloutions about this
I just resolved this problem with creating a custom SocketFactory
i tried to bind the local ip address in
createSocket()then i just usedMySocketFactoryinOKHttp