// https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Guides/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file
// https://www.zhihu.com/search?type=content&q=%E8%87%AA%E5%B7%B1%E5%86%99%E4%B8%80%E4%B8%AA%E4%BB%A3%E7%90%86%E5%B7%A5%E5%85%B7


// https://a.idydz.top/api/v1/client/subscribe?token=60d7daca87c1c7c52ac028289e76720f


var domains = new Set([
    "google.com",
    "youtube.com",
    "chatgpt.com"
]);


function FindProxyForURL(url, host) {
    var proxy = "SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080; PROXY 127.0.0.1:8888; DIRECT;";

    while (host.indexOf('.') !== -1) {
        if (domains.has(host)) {
            return proxy;
        }
        host = host.substring(host.indexOf('.') + 1);
    }

    return "DIRECT;";
}
