rescu icon indicating copy to clipboard operation
rescu copied to clipboard

change IP address per request - spoof

Open mahalamobile opened this issue 7 years ago • 2 comments

Hi

Am using XChange github which makes REST calls to exchange API's and uses rescu as part of the call. Is there anyway to set the from IP address for each call?

thanks

mahalamobile avatar Nov 23 '17 13:11 mahalamobile

There is no explicit support for this in rescu currently. However, rescu uses java.net.HttpURLConnection under the hood to create connections; see if HttpURLConnection supports what you want, then we might find a way to do it.

mmazi avatar Nov 24 '17 13:11 mmazi

According to docs I found googling, you'd have to create your own URLStreamHandlerFactory. That would allow you to intercept each open connection attempt, and return the URLStreamHandler with a hostAddress of your choosing for the particular request.

traviscollins avatar Feb 26 '18 13:02 traviscollins