How to rotate ip address of each request from same machine
My requirement is开发者_StackOverflow中文版 to rotate ip address for each http requests originating from single machine. Is it possible to control IP of each request at application level assuming I have a set of registered IP addresses with me ?
Thanks
Jitendra
Sure, all you have to do it to bind the socket to the address you want to use. See Socket::bind(SocketAddress)
and SocketFactory::createSocket(InetAddress, int, InetAddress, int)
.
You most likely want to use a library to do the request; you'll have to find a way to specify e.g. the SocketFactory
the library will use (or it may already accept a local address).
精彩评论