Answer the question
In order to leave comments, you need to log in
How to create a GET request using PHP with IP address spoofing?
There is a certain service from which it is necessary to pull data. The peculiarity of this service is that it allows only 20 requests in 5 minutes, after which the IP is blocked for an indefinite time (10-20 minutes) and 429 (Too many requests) comes in the response. And we need to make about 100 requests at a time.
The server from which the request is made has 8 IP addresses. I decided to make every 20 requests from a new ip address.
When requesting via Guzzle, I tried to replace X-Real-Ip and X-Forwarder-For, and also slipped CURLOPT_INTERFACE into the curl config indicating the desired IP. But as a result, the same address is sent (I checked it by sending a request to my other server, in which I catch $_SERVER['REMOTE_ADDR'])
Then I decided that it was possible to create a direct request through sockets. But never worked with sockets.
PS. The request must be on HTTPS. That is, there is still apparently difficulty with decoding
Answer the question
In order to leave comments, you need to log in
Just use a proxy, when you get 429, just change the ip proxy
free (request time can be up to 2 seconds)
Paid (you can’t buy 10 proxies, price
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question