| 1 | function FindProxyForURL(url, host) { |
|---|
| 2 | return (isPlainHostName(host) || |
|---|
| 3 | url.indexOf("ftp:") == 0 || |
|---|
| 4 | //url.indexOf("gopher:") == 0 || // Gopher never die!!! |
|---|
| 5 | dnsDomainIs(host, "2ch.net") || |
|---|
| 6 | /* |
|---|
| 7 | url.indexOf("http://www.tumblr.com/api/write/") == 0 || |
|---|
| 8 | url.indexOf("http://www.lingr.com/api/") == 0 || |
|---|
| 9 | url.indexOf("http://twitter.com/statuses/") == 0 || |
|---|
| 10 | url.indexOf("http://www.google.com/reader/atom/") == 0 || |
|---|
| 11 | shExpMatch(url, "http://*.megalodon.jp/*") || |
|---|
| 12 | */ |
|---|
| 13 | localHostOrDomainIs(host, "idisk.mac.com") || |
|---|
| 14 | isInNet(host, "10.0.0.0", "255.0.0.0") || |
|---|
| 15 | isInNet(host, "127.0.0.0", "255.0.0.0") || |
|---|
| 16 | isInNet(host, "172.16.0.0", "255.240.0.0") || |
|---|
| 17 | isInNet(host, "169.254.0.0", "255.255.0.0") || |
|---|
| 18 | isInNet(host, "192.168.0.0", "255.255.0.0") || |
|---|
| 19 | isInNet(host, "192.0.2.0", "255.255.255.0") || |
|---|
| 20 | isInNet(host, "224.0.0.0", "224.0.0.0") |
|---|
| 21 | ? "DIRECT" |
|---|
| 22 | : "PROXY 127.0.0.1:8123; DIRECT"); |
|---|
| 23 | } |
|---|