rescu
rescu copied to clipboard
change IP address per request - spoof
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
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.
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.