Proxy Proposal: Stage 1

Overview

A proposal for the first stage of work to add an extension API to modify the proxy settings used by chromium. See the original complete proposal for additional justification and Q&A.

Goals

  • An extension may specify a proxy server, including scheme, URL, and optional port, for one or more available schemes.
  • An extension may indicate that a particular scheme is to be accessed without using a proxy.
  • Extension-specified proxies override system proxy settings.
  • Proxies may be changed without the need for a browser restart that the current command-line options --proxy-server and --no-proxy-server require.
  • Collections of proxy settings may be turned on or off by UI provided by an extension, or by enabling and disabling multiple proxy-manipulating extensions.

Non-Goals

The following features will not be offered in this initial implementation. Their status in future implementations remains subject to discussion.
  • Use of a proxy auto-config (PAC) specification, either from a file, a URL, or custom data.
  • Auto-detection of proxy settings.
  • Access to current or system proxy settings.
  • Overriding individual portions of system proxy settings.
  • Local bypass and a local-bypass pattern list.
  • Fallback of settings from one extension to another, or from extensions to system settings.

Conflict Resolution

 The expectation is that most users will have at most one proxy extension installed and enabled, since one full-featured extension can easily provide complete control. Conflict resolution is thus rather basic and has the primary goal of reducing confusion about which setting is coming from where.
  • If more than one extension with the "proxy settings" privilege is installed and enabled, the last extension to load will take complete control of the proxy settings. Proxy settings attempted by other extensions will be entirely ignored until the "winning" extension is disabled or uninstalled, at which time a new "winner" will be selected in reverse order of loading and will assume complete control.
  • Similarly, when any extension with the "proxy settings" privilege is installed and enabled, no system proxy settings will be used for any scheme.
  • Note that in particular, this means that an extension that requests the privilege but does not set a proxy for a particular scheme effectively disables proxies for that scheme. If it sets no proxies at all, it causes all network requests to be sent directly.
  • If all extensions with the "proxy settings" privilege are disabled or uninstalled, the system settings will be used.
UI Impact

The current UI is

Network
 Set up a proxy to connect to the network.
   [ Change proxy settings ]

In the default case of no proxy extensions, this would be changed to

Network
 Chrome is using your computer's system proxy
 settings to connect to the network.
   [ Change system proxy settings ]

When any extension with the "proxy settings" privilege is installed and enabled, the text would be changed and the button disabled:

Network
 Your network proxy settings are being managed
 by an extension.
   [ Change system proxy settings ]

In order to return to using system settings, the user disables or uninstalls any proxy extensions from chrome://extensions/ as usual.

API Portions Included in this Stage

See the full proposal for details of these features.
class ProxyServer

struct ProxyRules {
// Partial implementation!
ProxyServer singleProxy;
ProxyServer proxyForHttp; ProxyServer proxyForHttps; ProxyServer proxyForFtp; ProxyServer socksProxy;
}

struct ProxyConfig {
// Partial implementation! ProxyRules rules; }

void useCustomProxySettings(ProxyConfig config)

API Portions Deferred to Later Stages

These features may or may not be implemented later.

struct PacScript

struct ProxyRules {
// Partially deferred.
bool bypassLocal; string[] bypassList; }

struct ProxyConfig {
// Partially deferred. bool autoDetect; PacScript customPacScript; }
struct ProxySettings

void getCurrentProxySettings(void callback(ProxySettings)) void getSystemProxySettings(void callback(ProxyConfig))

void useSystemProxySettings()
Comments