{"id":1561,"date":"2022-10-09T18:20:19","date_gmt":"2022-10-09T18:20:19","guid":{"rendered":"https:\/\/sunucucozumleri.com\/?p=1561"},"modified":"2024-01-18T10:45:45","modified_gmt":"2024-01-18T07:45:45","slug":"php-curl-ile-proxy-kullanmak-ve-proxy-istekleri-gondermek","status":"publish","type":"post","link":"https:\/\/sunucucozumleri.com\/blog\/php-curl-ile-proxy-kullanmak-ve-proxy-istekleri-gondermek\/","title":{"rendered":"PHP Curl ile Proxy Kullanmak ve Proxy \u0130stekleri G\u00f6ndermek"},"content":{"rendered":"<p>Merhabalar,<\/p>\n<p>PHP script ile curl komutunu kullanarak <a href=\"https:\/\/sunucucozumleri.com\/blog\/073-proxy-nedir-proxy-nasil-kullanilabilir\/\">proxy<\/a> arac\u0131l\u0131\u011f\u0131yla istekler g\u00f6nderece\u011fiz.<\/p>\n<p>\u00d6rnek PHP kodumuz a\u015fa\u011f\u0131daki gibidir.<\/p>\n<p><code><br \/>\n$url = 'https:\/\/google.com';<br \/>\n$proxyauth = 'user:pass';<br \/>\n$proxy = '200.111.182.6';<br \/>\n$proxyPort = '443';<br \/>\n$ch = curl_init();<br \/>\ncurl_setopt($ch, CURLOPT_URL, $url);<br \/>\n\/\/proxy suport<br \/>\ncurl_setopt($ch, CURLOPT_PROXY, $proxy);<br \/>\ncurl_setopt($ch, CURLOPT_PROXYPORT, $proxyPort);<br \/>\n\/\/curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyauth);<br \/>\ncurl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');<br \/>\ncurl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);<br \/>\n\/\/https<br \/>\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);<br \/>\ncurl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla\/5.0 (Windows NT 6.1) AppleWebKit\/537.36 (KHTML,like Gecko) Chrome\/27.0.1453.94 Safari\/537.36\");<br \/>\ncurl_setopt($ch, CURLOPT_HEADER, 0);<br \/>\ncurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);<br \/>\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br \/>\ncurl_setopt($ch, CURLOPT_TIMEOUT, 100);<\/code><\/p>\n<p>$output = curl_exec($ch);<\/p>\n<p>if(curl_exec($ch) === false)<br \/>\n{<br \/>\necho &#8216;Curl error: &#8216; . curl_error($ch);<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\necho &#8216;Operation completed without any errors&#8217;;<br \/>\n}<\/p>\n<p>echo $output;<\/p>\n<p>curl_close($ch);<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Merhabalar, PHP script ile curl komutunu kullanarak proxy arac\u0131l\u0131\u011f\u0131yla istekler g\u00f6nderece\u011fiz. \u00d6rnek PHP kodumuz a\u015fa\u011f\u0131daki gibidir. $url = &#8216;https:\/\/google.com&#8217;; $proxyauth = &#8216;user:pass&#8217;; $proxy = &#8216;200.111.182.6&#8217;; $proxyPort = &#8216;443&#8217;; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); \/\/proxy suport curl_setopt($ch, CURLOPT_PROXY, $proxy); curl_setopt($ch, CURLOPT_PROXYPORT, $proxyPort); \/\/curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyauth); curl_setopt($ch, CURLOPT_PROXYTYPE, &#8216;HTTP&#8217;); curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); \/\/https curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); &hellip;<\/p>\n","protected":false},"author":1,"featured_media":1456,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-1561","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"acf":[],"_links":{"self":[{"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/posts\/1561","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/comments?post=1561"}],"version-history":[{"count":0,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/posts\/1561\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/media\/1456"}],"wp:attachment":[{"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/media?parent=1561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/categories?post=1561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/tags?post=1561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}