Google Chrome 扩展中的 SOCKS5 代理身份验证

2023-12-21

我正在尝试创建一个扩展,它将使用我的 SOCKS5 代理进行身份验证。 我的后台脚本中的代码是这样的:

var config = {
    mode: "fixed_servers",
    rules: {
        fallbackProxy: {
            scheme: "socks5",
            host: "myhostaddress"
        }
    }
};
chrome.proxy.settings.set(
    { value: config, scope: 'regular' },
    function () { });

chrome.webRequest.onAuthRequired.addListener(
    function (details) {
        console.log("onAuthRequired!", details);
        return ({
            authCredentials: {
                'username': "uname",
                'password': "pass"
            }
        });
    },
    { urls: ["<all_urls>"] },
    ['blocking']
);

但我总是得到ERR_SOCKS_CONNECTION_FAILED每页都有错误... 我究竟做错了什么?


如中所述thread https://www.privateinternetaccess.com/forum/discussion/4222/socks5-proxy-can-not-connect, Chrome 不支持带身份验证的 SOCKS5 代理。唯一可能支持的浏览器是傲游浏览器 http://www.maxthon.com/.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Google Chrome 扩展中的 SOCKS5 代理身份验证 的相关文章

随机推荐