How to throw an HTTP request through a Proxy in PHP

Admin Blog

I'm Nishimura from Development Department, and I'd like to summarize the result of my research on the requirement of throwing a request through Proxy server in PHP.


With the following code, you can get "" through the proxy server located at "tcp://". That's easy!


The default timeout for file_get_contents is 60 seconds, so be careful to specify an appropriate time depending on your requirements. If you expect it to take a long time to respond, you should set it longer, and if you are using it for life and death check, you should set it shorter.

Kaonavi×learningBOX collaboration memorial campaign is underway!
academic campaign

  • Comment ( 0 )

  • Trackbacks are closed.

  1. No comments yet.

Related posts