Skip to content

Instantly share code, notes, and snippets.

@Sansui233
Last active December 11, 2025 04:16
Show Gist options
  • Select an option

  • Save Sansui233/063fba4fdb8354714172d8e27015bdc3 to your computer and use it in GitHub Desktop.

Select an option

Save Sansui233/063fba4fdb8354714172d8e27015bdc3 to your computer and use it in GitHub Desktop.
var FindProxyForURL = function(init, profiles) {
return function(url, host) {
"use strict";
var result = init, scheme = url.substr(0, url.indexOf(":"));
do {
if (!profiles[result]) return result;
result = profiles[result];
if (typeof result === "function") result = result(url, host, scheme);
} while (typeof result !== "string" || result.charCodeAt(0) === 43);
return result;
};
}("+7890", {
"+7890": function(url, host, scheme) {
"use strict";
if (/^::1$/.test(host) || /^127\.0\.0\.1$/.test(host) || /\.anzz\.site$/.test(host) || /agedm\.vip$/.test(host) || /^baidu\.com$/.test(host) || /\.baidu\.com$/.test(host) || /^b23\.tv$/.test(host) || /b23\.tv$/.test(host) || /^bilibili\.com$/.test(host) || /\.bilibili\.com$/.test(host) || /\.biligame\.com$/.test(host) || /\.bilivideo\.com$/.test(host) || /bupt\.edu\.cn$/.test(host) || /byr\.cn$/.test(host) || /\.hdslb\.com$/.test(host) || /huorong\.cn$/.test(host) || /\.itzmx\.com$/.test(host) || /jsxiaoshi\.com$/.test(host) || /kanxue\.com$/.test(host) || /localhost$/.test(host) || /lookae\.com$/.test(host) || /mcbbs\.net$/.test(host) || /piclist\.cn$/.test(host) || /^qq\.com$/.test(host) || /\.qq\.com$/.test(host) || /sina\.com$/.test(host) || /sina\.com\.cn$/.test(host) || /sinaimg\.cn$/.test(host) || /sinajs\.cn$/.test(host) || /shopimgs\.com$/.test(host) || /steamdb\.info$/.test(host) || /steamtools\.net$/.test(host) || /testipv6\.com$/.test(host) || /^weibo\.com$/.test(host) || /\.weibo\.com$/.test(host) || /\.weibocdn\.com$/.test(host) || /\.weiyun\.com$/.test(host) || /xet\.citv\.cn$/.test(host) || /xet\.tech$/.test(host) || /xiaoeknow\.com$/.test(host) || /\.xiaoeknow\.com$/.test(host)) return "DIRECT";
return "PROXY 127.0.0.1:7890";
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment