ankit.vic
ankit.vic

Reputation: 101

Bypass Intranet traffic for proxy in chrome extension

I am working on an extension where proxy is set through my extension using chrome extension proxy api(chrome.proxy.settings). Everything works fine and I get all traffic on my proxy server. However, I am having trouble with the intranet traffic.

If I try to access any ip on my local network, my printer or any other system, I cannot. Is there a way to bypass the intranet requests so that they do not go through proxy? I found <local> but is not what I need.

Anyone faced a similar problem? Any direct method to bypass the same or any work around would be appreciated.

Upvotes: 0

Views: 1765

Answers (1)

Xan
Xan

Reputation: 77523

Is there a way to bypass the intranet requests so that they do not go through proxy?

As far as I understand, not automatically. The notion of "intranet" is something not easily guessed - it depends on how your network is organized.

Perhaps you could allow the user to input network blocks that they consider intranet - in CIDR notation that Chrome API accepts. The list of private addresses seems like a good default.

var intranet_list = [
  "fd00::/8",
  "10.0.0.0/8",
  "172.16.0.0/12",
  "192.168.0.0/16",
  "<local>"
]; // Make this configurable

var config = {
  /* ... */
  rules: {
    /* ... */
    bypassList: intranet_list
  }
};
chrome.proxy.settings.set({
  value: config,
  scope: "regular"
});

Upvotes: 1

Related Questions