python - tornado.httpclient.AsyncHTTPClient如何使用代理请求一个http服务?
迷茫
迷茫 2017-04-17 17:12:00
0
3
969
迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

Antworte allen(3)
迷茫
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

Peter_Zhu

Proxies are currently only supported with curl_httpclient.

via http://www.tornadoweb.org/en/stable/httpclient.html#tornado.httpclient.HTTPRequest

洪涛
httpclient.AsyncHTTPClient.configure(
            "tornado.curl_httpclient.CurlAsyncHTTPClient"
        )

这个文档有说明,只有curl_httpclient支持代理,你需要这么配置。
使用的时候给fetch函数加上代理参数就行proxy_host="127.0.0.1", proxy_port=8787。

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!