SwitchProxy for Firefox + proxy.pac
除了前面所介紹的FoxyProxy 之外, Firefox 用戶也不妨考慮 "[URL="https://addons.mozilla.org/en-US/firefox/addon/125"]SwitchProxy Tool :: Firefox Add-ons[/URL]"
IE 設定: 控制台 -> 網際網路選項 -> 連線 -> 設定值 -> 使用自動組態指令碼
Firefox 工具 -> 選項 -> 進階 -> 網路 -> 設定 -> Proxy 自動設定網址
網址輸入 [B]file://c:\proxy.pac[/B] 或 [B]file:///c:/proxy.pac[/B] (請自行將 "c:" 改成檔案正確存放位置)
然後建立一個純文字檔 "[B]proxy.pac[/B]", 以下範例適用於Hinet 用戶:
[CODE]function FindProxyForURL(url,host) {
// Convert hostname to lower case.
tmp = host.toLowerCase();
host = tmp;
// Process specific rules first. Run UltraSurf (9666), Freegate_F3 (8580), Garden (8081) or GPass.
if ((host == "www.pandora.com") ||
(host == "video.cgi.cbs.com") ||
(host == "www.grandcentral.com")
) return "PROXY 127.0.0.1:9666; PROXY 127.0.0.1:8580; PROXY 127.0.0.1:8081; DIRECT";
// Bypass https, ftp and mms.
tmp = url.substring(0,5);
protocol = tmp.toLowerCase()
if (protocol != "http:") {
// alert ("Bypass " + url);
return "DIRECT";
}
// Setup default proxy
proxy = "PROXY proxy.hinet.net:80; DIRECT";
// Process specific rules first.
if (dnsDomainIs(host, ".cn") ||
dnsDomainIs(host, ".hk") ||
dnsDomainIs(host, ".jp")
) return proxy;
// Process speedy or private connections. Do not conflic with other rules.
if (dnsDomainIs(host, ".tw") ||
dnsDomainIs(host, ".cc") ||
dnsDomainIs(host, ".org") ||
dnsDomainIs(host, ".net") ||
dnsDomainIs(host, ".google.com") ||
dnsDomainIs(host, ".gmail.com") ||
dnsDomainIs(host, ".yahoo.com") ||
dnsDomainIs(host, ".yimg.com") ||
dnsDomainIs(host, ".live.com") ||
dnsDomainIs(host, ".msn.com") ||
dnsDomainIs(host, ".hotmail.com") ||
dnsDomainIs(host, ".microsoft.com") ||
dnsDomainIs(host, ".flickr.com") ||
dnsDomainIs(host, ".ebay.com") ||
dnsDomainIs(host, ".taobao.com") ||
dnsDomainIs(host, ".mobile01.com") ||
dnsDomainIs(host, ".5i01.com") ||
dnsDomainIs(host, ".shopping01.com") ||
dnsDomainIs(host, ".dd-wrt.com") ||
dnsDomainIs(host, ".openwrt.org") ||
dnsDomainIs(host, ".wl500g.info") ||
dnsDomainIs(host, ".hinet.net")
) return "DIRECT";
// Safely checking local IP address spaces.
// Do not include the "g" flag in the IP regex expression
if ((host.substring(0,1) == "1") ||
(host.substring(0,1) == "2")
) {
reip = /^\d+\.\d+\.\d+\.\d+$/;
if (reip.test(host)) {
// if (shExpMatch(host, "/^\d+\.\d+\.\d+\.\d+$/")) {
// if (isInNet(host, "192.168.0.0", "255.255.0.0") ||
// isInNet(host, "172.16.0.0", "255.240.0.0") ||
// isInNet(host, "10.0.0.0", "255.0.0.0") ||
// isInNet(host, "169.254.0.0", "255.255.0.0")
if (shExpMatch(host, "192.168.*") ||
shExpMatch(host, "172.16.*") ||
shExpMatch(host, "10.*") ||
shExpMatch(host, "224.*") ||
shExpMatch(host, "232.*") ||
shExpMatch(host, "233.*") ||
shExpMatch(host, "239.*") ||
shExpMatch(host, "169.254.*") ||
(host == "127.0.0.1")
) return "DIRECT";
}
}
// Check plain hostname and localhost
if (isPlainHostName(host) ||
// (host == "localhost") ||
shExpMatch(host, "localhost.*")
) return "DIRECT";
// alert ("Proxy alert!");
return proxy;
} // End of fuction
// Set "proxy.hinet.net:80" for Hinet users
// Set "proxy.seed.net.tw:8080" for Seednet users
// Copyleft: www.pczone.com.tw
// http://www.pczone.com.tw/thread/6/post/20756/1002231/#post1002231
// Reference: http://www.returnproxy.com/proxypac/
// Firefox: file:///c:/proxy.pac
// IE: file://c:/proxy.pac[/CODE]
以上原則是FIFO, 先吻合先執行, 請參考 "[URL="http://forum.moztw.org/viewtopic.php?t=7156"]Mozilla Taiwan 討論區: 尋找某網站對應某代理伺服器 (Proxy) 的功能[/URL]"
修改proxy.pac 之後, 必須由SwitchProxy 重新載入proxy.pac 或重新啟動IE, 變更才會生效, 以SwitchProxy 切換等同重新載入, [B][COLOR="Red"]務必注意左右括弧, 若不對稱, 則整個組態都無效[/COLOR][/B]
以上範例中, 如果沒有先執行UltraSurf, 就造訪Pandora 的話, 函式FindProxyForURL 會先檢查return "PROXY 127.0.0.1:9666" 是否有效, 若無效則改為 "DIRECT", 避免造成無法連結, 此時請先以SwitchProxy 切換為None, 接著執行UltraSurf, 再切換回原來的Proxy 設定, 就可以不用重新啟動Firefox
在SwitchProxy 之中, 小弟將以上使用自動組態指令碼命名為Default, 除此之外, 小弟還建立了Hinet, [URL="http://en.wikipedia.org/wiki/Proxomitron"]Proxomitron[/URL]/[URL="http://proximodo.sourceforge.net"]Proximodo[/URL] , [URL="http://www.wujie.net"]UltraSurf (無界)[/URL] 和[URL="http://us.dongtaiwang.com/loc/download_en.php"]Freegate (自由門/動態網)[/URL], 如果您需要絕對隱密, 那麼您可以考慮安裝[URL="http://www.vidalia-project.net"]Vidalia Bundles (包含Tor + Privoxy)[/URL], 另外, 請將區網IP 排除在外, 預設No Proxy for 的內容只有 "localhost, 127.0.0.1", 請再改為 "[B]localhost,127.0.0.1,192.168.0.0/16,172.16.0.0/20,10.0.0.0/24[/B]"
Switch Proxy Options 只保留 "Show Context Menu" 打勾, 其餘取消, 變換Proxy 範本不重新載入目前頁面, 請手動更新目前頁面
[URL="http://www.pczone.com.tw/thread/29/136379/"]另類代理 - 內容分發網路 Content Distribution Network (CDN)[/URL]
[URL="http://en.wikipedia.org/wiki/Proxy_auto-config"]Proxy auto-config - Wikipedia, the free encyclopedia[/URL]
[URL="http://www.microsoft.com/technet/prodtechnol/ie/ieak/techinfo/deploy/60/en/corpexjs.mspx"]JavaScript or JScript Auto-Proxy Example Files[/URL]
[URL="http://jcurnow.home.comcast.net/~jcurnow/WritingEffectivePACFiles.html"]Writing Effective Proxy Automatic Configuration (PAC) Files[/URL]
[URL="http://www.raymond.cc/blog/archives/2008/06/04/access-and-watch-veoh-even-if-veoh-is-no-longer-available-in-your-country/"]Access and Watch Veoh Even if Veoh Is No Longer Available in Your Country >> Raymond.CC Blog[/URL]
[URL="http://www.mydigitallife.info/2008/07/01/access-and-visit-us-only-restricted-websites-hulu-pandora-veoh-abc-cw-from-outside-of-united-states/"]Access and Visit US-Only Restricted Websites (Hulu, Pandora, Weoh, ABC, CW) from Outside of United States >> My Digital Life[/URL]
[B][URL="http://www.raymond.cc/forum/network/7478-howto-bypass-censorship-using-proxy-services.html"]HOWTO: Bypass censorship using proxy services - Raymond.CC Forum[/URL][/B]
[URL="http://en.wikipedia.org/wiki/IPv4"]IPv4 - Wikipedia, the free encyclopedia[/URL]
FF2 + SwitchProxy Tool 1.4.1, 請自行修改擴充套件 (以7-Zip 展開):
[B]install.rdf[/B]
[code]<em:maxVersion>[B][COLOR="Red"]3+[/COLOR][/B]</em:maxVersion>[/code]