迷茫2017-04-17 17:14:00
proxy_host (string) – HTTP proxy hostname. To use proxies, proxy_host and proxy_port must be set; proxy_username and proxy_pass are optional. Proxies are currently only supported with curl_httpclient.
To select curl_httpclient, call AsyncHTTPClient.configure at startup:
AsyncHTTPClient.configure("tornado.curl_httpclient.CurlAsyncHTTPClient")
稍微看看文件就好了 代理只支援 curl_httpclient
天蓬老师2017-04-17 17:14:00
代理目前僅支援curl_httpclient。
透過http://www.tornadoweb.org/en/stable/httpclient.html#tornado.httpclient.HTTPRequest
PHP中文网2017-04-17 17:14:00
httpclient.AsyncHTTPClient.configure(
"tornado.curl_httpclient.CurlAsyncHTTPClient"
)
這篇文件有說明,只有curl_httpclient支援代理,你需要這樣設定。
使用的時候給fetch函數加上代理參數就行proxy_host="127.0.0.1", proxy_port=8787。