proxy.ProxyInfo 编辑

Contains information about a proxy. This object, or an array of these objects, is returned from the listener to proxy.onRequest. It instructs the browser whether to proxy the request, and if so, which proxy to use.

Type

Values of this type are objects. They contain the following properties:

type

string. This describes whether to proxy at all, and if so, what kind of proxy to use. It may take one of the following values:

  • "direct": don't proxy the request. If this value is given, all other properties of this object are ignored.
  • "http": HTTP proxy (or SSL CONNECT for HTTPS)
  • "https": HTTP proxying over TLS connection to proxy
  • "socks": SOCKS v5 proxy
  • "socks4": SOCKS v4 proxy
host
string. The hostname of the proxy server. Mandatory unless type is "direct".
port
string. The port number of the proxy server. Mandatory unless type is "direct".
username
string. Username for the proxy service. This is usable with "socks". For HTTP proxy authorizations, use webRequest.onAuthRequired.
password
string. Password for the proxy service. This is usable with "socks". For HTTP proxy authorizations, use webRequest.onAuthRequired.
proxyDNS
boolean. If true, the proxy server is used to resolve certain DNS queries (only usable with "socks4" and "socks"). Defaults to false.
failoverTimeout
number.  Failover timeout in seconds. If the connection fails to connect the proxy server after this number of seconds, the next proxy server in the array returned from the proxy.onRequest listener will be used.
proxyAuthorizationHeader
string. This string, if set to non-empty, is passed directly as a value to the Proxy-Authorization request header sent to HTTP proxies as part of plain HTTP requests and CONNECT requests. In other words, this can be used to directly authenticate to HTTP proxies requiring (non-challenging) authentication.

For instance, if you want to send "username" and "password" for "basic" authentication, you can set the proxyAuthorizationHeader property to Basic dXNlcm5hbWU6cGFzc3dvcmQ=
connectionIsolationKey Optional
string. An optional key used for additional isolation of this proxy connection.

Browser compatibility

BCD tables only load in the browser

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:55 次

字数:4276

最后编辑:6 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文