Skip to content

Instantly share code, notes, and snippets.

@Seacolor
Created May 18, 2012 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Seacolor/2724756 to your computer and use it in GitHub Desktop.
Save Seacolor/2724756 to your computer and use it in GitHub Desktop.
nicoCache自動構成スクリプト(Zero対応)
function FindProxyForURL(url, host) {
// variable strings to return
var proxy_nicocache = "PROXY localhost:3573";
var proxy_non = "DIRECT";
if (shExpMatch(host, "msg*.nicovideo.jp*"))
return proxy_non;
if (shExpMatch(host, "riapi.nicovideo.jp*"))
return proxy_non;
if ((shExpMatch(host, "*nicovideo.jp*") ||
shExpMatch(host, "*smilevideo.jp*")) &&
url.substring(0, 5) == "http:") {
return proxy_nicocache;
}
return proxy_non;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment