I wanted to send a get request to site using file_get_contents(URL). But the problem is the URL only accepts requests from certain IP addresses. I wanna know if I can send the same request from my webserver so that it appears to that server as if the request comes the IP that it allows
Asked
Active
Viewed 1,783 times
-1
-
how would the request flow back to you? – Paul Bastide Dec 05 '14 at 13:19
-
Why downvotes? For people with PHP skills and small networking background this can be very helpful, especialy the answer in here. – Fusion Jun 11 '16 at 10:45
1 Answers
6
IP addresses are addresses which determine where a certain piece of data will be sent. If you fake your own sender IP address, you'll never receive a reply. You'd have to do some serious network level shenanigans and manipulate a bunch of relevant infrastructure to fake a TCP/IP handshake and still be able to receive the returned response.
In other words: no. You need to actually control the IP address you want to send from.
Guess why that server is using IP address filtering as security check. Because it's pretty secure.

deceze
- 510,633
- 85
- 743
- 889