Chrome扩展 - 绕过代理程序

问题描述 投票:2回答:1

我的工作,代理是通过我的分机使用Chrome扩展代理API(chrome.proxy.settings)设置的延伸。一切正常,我也得到除当然bypass list的那些我的代理服务器上的所有流量。

现在的问题是:How do we bypass the proxy set dynamically?我的意思是有没有办法以编程方式绕过某些URL(不在代理绕过列表)代理?我明白绕过列表包含的URL /模式被绕过。但我需要一些网址为绕过去代理。

任何人都面临着类似的要求?任何直接的方法来绕过相同动态地或任何变通,将不胜感激。

google-chrome google-chrome-extension proxy google-chrome-os chromebook
1个回答
0
投票

在旅途中不使用代理?您可以从您的Web服务器拉任何具体的地址。什么是问题?

例如:

chrome.windows.onCreated.addListener(function() {
  var config = {
      mode: 'fixed_servers',
      rules: {
        proxyForHttp: {
          scheme: 'http',
          host: '127.0.0.1',
          port: '80'
        },
        bypassList: []
      }
    },
    proxyByUrl = 'path/to/proxiesByUrl?path=' + window.location.href;

  $.get(proxyByUrl, function(data) {
    // Set up current proxy, dependent on request URL
    config.rules.proxyForHttp.host = data.proxyAddress;
    config.rules.proxyForHttp.port = data.proxyport;
    // Excluded URL's for this proxy
    bypassList.push(data.bypassUrls);
  });
});

符合该模式匹配的所有主机名。一家领先的“”被解释为“*”。例如: “foobar.com”, “foobar.com”, “.foobar.com”, “foobar.com:99”, “https://x..y.com:99”。

对于bypassList,read the official documentation的更详细的模式。

© www.soinside.com 2019 - 2024. All rights reserved.