Cleanup docs and code of setProxy
This commit is contained in:
parent
34c9279fc5
commit
192fa4c86b
2 changed files with 38 additions and 43 deletions
|
@ -186,37 +186,34 @@ Clears the data of web storages.
|
|||
* `proxyRules` String - Rules indicating which proxies to use.
|
||||
* `callback` Function - Called when operation is done.
|
||||
|
||||
Sets the proxy settings.
|
||||
|
||||
When `pacScript` and `proxyRules` are provided together, the `proxyRules`
|
||||
option is ignored and `pacScript` configuration is applied.
|
||||
|
||||
```
|
||||
proxyRules = scheme-proxies[";"<scheme-proxies>]
|
||||
scheme-proxies = [<url-scheme>"="]<proxy-uri-list>
|
||||
url-scheme = "http" | "https" | "ftp" | "socks"
|
||||
proxy-uri-list = <proxy-uri>[","<proxy-uri-list>]
|
||||
proxy-uri = [<proxy-scheme>"://"]<proxy-host>[":"<proxy-port>]
|
||||
The `proxyRules` has to follow the rules bellow:
|
||||
|
||||
For example:
|
||||
"http=foopy:80;ftp=foopy2" -- use HTTP proxy "foopy:80" for http://
|
||||
URLs, and HTTP proxy "foopy2:80" for
|
||||
ftp:// URLs.
|
||||
"foopy:80" -- use HTTP proxy "foopy:80" for all URLs.
|
||||
"foopy:80,bar,direct://" -- use HTTP proxy "foopy:80" for all URLs,
|
||||
failing over to "bar" if "foopy:80" is
|
||||
unavailable, and after that using no
|
||||
proxy.
|
||||
"socks4://foopy" -- use SOCKS v4 proxy "foopy:1080" for all
|
||||
URLs.
|
||||
"http=foopy,socks5://bar.com -- use HTTP proxy "foopy" for http URLs,
|
||||
and fail over to the SOCKS5 proxy
|
||||
"bar.com" if "foopy" is unavailable.
|
||||
"http=foopy,direct:// -- use HTTP proxy "foopy" for http URLs,
|
||||
and use no proxy if "foopy" is
|
||||
unavailable.
|
||||
"http=foopy;socks=foopy2 -- use HTTP proxy "foopy" for http URLs,
|
||||
and use socks4://foopy2 for all other
|
||||
URLs.
|
||||
```
|
||||
proxyRules = schemeProxies[";"<schemeProxies>]
|
||||
schemeProxies = [<urlScheme>"="]<proxyURIList>
|
||||
urlScheme = "http" | "https" | "ftp" | "socks"
|
||||
proxyURIList = <proxyURL>[","<proxyURIList>]
|
||||
proxyURL = [<proxyScheme>"://"]<proxyHost>[":"<proxyPort>]
|
||||
```
|
||||
|
||||
For example:
|
||||
* `http=foopy:80;ftp=foopy2` - Use HTTP proxy `foopy:80` for `http://` URLs, and
|
||||
HTTP proxy `foopy2:80` for `ftp://` URLs.
|
||||
* `foopy:80` - Use HTTP proxy `foopy:80` for all URLs.
|
||||
* `foopy:80,bar,direct://` - Use HTTP proxy `foopy:80` for all URLs, failing
|
||||
over to `bar` if `foopy:80` is unavailable, and after that using no proxy.
|
||||
* `socks4://foopy` - Use SOCKS v4 proxy `foopy:1080` for all URLs.
|
||||
* `http=foopy,socks5://bar.com` - Use HTTP proxy `foopy` for http URLs, and fail
|
||||
over to the SOCKS5 proxy `bar.com` if `foopy` is unavailable.
|
||||
* `http=foopy,direct://` - Use HTTP proxy `foopy` for http URLs, and use no
|
||||
proxy if `foopy` is unavailable.
|
||||
* `http=foopy;socks=foopy2` - Use HTTP proxy `foopy` for http URLs, and use
|
||||
`socks4://foopy2` for all other URLs.
|
||||
|
||||
### `ses.resolveProxy(url, callback)`
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue