var FindProxyForURL = function(init, profiles) {
return function(url, host) {
"use strict";
var result = init, scheme = url.substr(0, url.indexOf(":"));
do {
result = profiles[result];
if (typeof result === "function") result = result(url, host, scheme);
} while (typeof result !== "string" || result.charCodeAt(0) === 43);
return result;
};
}("+proxy", {
"+proxy": function(url, host, scheme) {
"use strict";
// 本地地址直连
if (/^127\.0\.0\.1$/.test(host) || /^::1$/.test(host) || /^localhost$/.test(host)) {
return "DIRECT";
}
// 指定网站使用代理
if (
/^chatgpt\.com$/.test(host) ||
/^claude\.ai$/.test(host) ||
/^whoer\.net$/.test(host)
) {
return "PROXY gw.cloudbypass.com:1288";
}
// 其他网站直连
return "DIRECT";
}
});