array('timeout' => 5, 'proxy' => 'tcp://127.0.0.1:8118', 'request_fulluri' => True,) ) ); $result = file_get_contents($url, False, $ctx); echo $result; /* //curl 使用 $ci = curl_init(); $url = "http://www.youtube.com"; curl_setopt($ci, CURLOPT_HTTPPROXYTUNNEL, TRUE); curl_setopt($ci, CURLOPT_PROXY, '127.0.0.1:8118'); curl_setopt($ci, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); curl_setopt($ci, CURLOPT_URL, $url); curl_setopt($ci, CURLOPT_RETURNTRANSFER, 1); echo "starting..."; $response = curl_exec($ci); curl_close($ci); echo "end"; var_dump($response); */ ?>
2. [代码]python代码
import urllib2 proxy = '127.0.0.1:8118' url="http://www.youtube.com" opener = urllib2.build_opener( urllib2.ProxyHandler({'http':proxy}) ) urllib2.install_opener( opener ) sContent = urllib2.urlopen(url).read() filepath="a.html" file1=open(filepath,'wb') file1.write(sContent) file1.close()
3. [代码]curl脚本
#使用http代理 curl -x 127.0.0.1:8118 -o m1.mp3 http://realaudio.rferl.org/voa/LERE/manual/2013/05/17/1e86b46f-17b6-4988-9ba2-2c3c635c4d3c.mp3 #使用socks5 curl --socks5 127.0.0.1:8888 -o m.mp3 http://realaudio.rferl.org/voa/LERE/manual/2013/05/17/1e86b46f-17b6-4988-9ba2-2c3c635c4d3c.mp3
陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
1 個月前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
1 個月前By尊渡假赌尊渡假赌尊渡假赌
刺客信條陰影:貝殼謎語解決方案
3 週前ByDDD
Windows 11 KB5054979中的新功能以及如何解決更新問題
2 週前ByDDD
威爾R.E.P.O.有交叉遊戲嗎?
1 個月前By尊渡假赌尊渡假赌尊渡假赌

熱工具

PhpStorm Mac 版本
最新(2018.2.1 )專業的PHP整合開發工具

SAP NetWeaver Server Adapter for Eclipse
將Eclipse與SAP NetWeaver應用伺服器整合。

SublimeText3 英文版
推薦:為Win版本,支援程式碼提示!

Atom編輯器mac版下載
最受歡迎的的開源編輯器

Dreamweaver Mac版
視覺化網頁開發工具