I am getting data for my application from a website, say x.com. I use the php function file_get_contents() to fetch the data. It is sure that , my server's ip address will be shown in x.com 's logs. Is there any way to hide my server's ip without using proxy?
If I have a proxy ,how to use it with file_get_contents() ?
I need to send the request in both HTTP POST and HTTP GET methods
test.php using http://ifconfig.me/ip
code modified from http://www.php.net/manual/en/function.file-get-contents.php
Definitely agree with farmer1992.
For anyone having issues with
file_get_contents
over SSL + proxy, there is a known bug with PHP's stream_context_create:https://bugs.php.net/bug.php?id=63519
Fortunately, the workaround is simple. Basically, the context creator gets confused when parsing an "https" target URL to both the proxy and SSL configs. You just have to set the SNI_server_name in the SSL config:
Hopefully that saves someone some time!