{"id":56324,"date":"2021-09-12T14:34:58","date_gmt":"2021-09-12T05:34:58","guid":{"rendered":"https:\/\/learningbox.online\/?p=56324"},"modified":"2021-09-12T15:43:05","modified_gmt":"2021-09-12T06:43:05","slug":"php_proxy_file_get_contents_http_request","status":"publish","type":"post","link":"https:\/\/learningbox.online\/en\/column\/php_proxy_file_get_contents_http_request\/","title":{"rendered":"How to throw an HTTP request through a Proxy in PHP"},"content":{"rendered":"<p>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.<\/p>\n<h2>code<\/h2>\n<p>With the following code, you can get \"https:\/\/www.ugtop.com\/spill.shtml\" through the proxy server located at \"tcp:\/\/123.123.123.123:8080\". That's easy!<br \/>\n<script src=\"https:\/\/gist.github.com\/ynishi2014\/bafc87d360536ac44c4049e88b90155a.js\"><\/script><\/p>\n<h2>memo<\/h2>\n<p>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.<\/p>","protected":false},"excerpt":{"rendered":"This is Nishimura from the Development Department, I have a requirement to throw a request through a Proxy server in PHP, so I'll summarize the results of my investigation. Code The following code will allow you to use the \"tc...","protected":false},"author":5,"featured_media":32064,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_crdt_document":"","content-type":"","_lmt_disableupdate":"yes","_lmt_disable":"","advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_vk_print_noindex":"","_veu_custom_css":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[359],"tags":[],"class_list":["post-56324","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-others"],"acf":[],"modified_by":"i.hirota","jetpack_featured_media_url":"https:\/\/learningbox.online\/wp-content\/uploads\/2020\/02\/1696211.jpg","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pgWaOl-eEs","_links":{"self":[{"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/posts\/56324","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/comments?post=56324"}],"version-history":[{"count":17,"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/posts\/56324\/revisions"}],"predecessor-version":[{"id":56341,"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/posts\/56324\/revisions\/56341"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/media\/32064"}],"wp:attachment":[{"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/media?parent=56324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/categories?post=56324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/tags?post=56324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}