Controlling IP Addresses of Requests
By default, the proxy servers will choose a random IP for every request. But you can modify that behavior using custom headers.
The custom headers listed below allow you to specify exact IPs. In order to use them, you must get IP values from the
X-ProxyMesh-IP response header.
Use this header when you want to specify a particular IP for a request.
This IP should come from the
X-ProxyMesh-IP response header of a previous request. If the IP is no longer available, you will get a
502 error code with the
X-ProxyMesh-IP-Not-Found response header.
Use this header when you want to use a specific IP for a request, but you also want the request to succeed even if the IP is no longer available.
This is like the
X-ProxyMesh-IP header, but when an IP is not available, a random IP is chosen instead.
X-ProxyMesh-IPresponse header to the IP you sent with the
X-ProxyMesh-Prefer-IPheader. If they are different, then the IP you tried to use is no longer available.
Use this header to exclude a specific IP from the available choices. An IP other than the excluded IP will be chosen at random.
You can also send a comma-separated-values list of IPs to exclude multiple IPs. You will get a
502 error code if no more IPs are available, after excluding the IPs sent in the header.
Authentication Header String
Another method for controlling the IP addresses is to use a random string in the
Recording IP Addresses of Requests
For future use, you may want to make a list of the IP addresses that the proxy sends to a remote server for your request.
You could send IPs, for example, in one of the custom headers discussed in this article. Or, in high-traffic operations, you could choose multiple IPs from a list to reduce concurrent requests from a single IP.
Please review the note on caching under “X-ProxyMesh-Not-IP.” You may also want to review " Best Practices" in High-Traffic Proxy Connections.
IP Addresses Blocked by Geolocation
Some remote sites use geolocation to detect the location of IP addresses from a specific server.
Geolocation may report some IP addresses as being in a different location from the one you intend. That can be a problem if the reported geolocation of the IP address is far distant from the remote site.
If this causes your requests to be blocked, please read the IP Geolocation article for possible solutions.