Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Normally firefox and other browsers allow users to set an exclusive list in which proxy won't apply to the specified domain names or ip addresses? My question is that how to do it other way around to specify only the domains to let the proxy to apply to?

share|improve this question
add comment

2 Answers

If you want to configure the browsers of multiple machines in a standard way, just about all popular browsers support the proxy auto-config file. This allows you to have an arbitrarily complex set of rules for whether to use a proxy and which one to use, and means you solve the problem for all popular browsers.

An example proxy.pac that could meet your described requirements:

// proxy.pac: Proxy Auto-Configuration file.

function FindProxyForURL( url, host ) {

    var proxy_spec = "proxy.localnet:3128";

    // Default to using no proxy.
    var ProxyConfig = "DIRECT";

    if(
        dnsDomainIs( host, ".foo.example.org" ) ||
        dnsDomainIs( host, ".bar.example.com" ) ||
        dnsDomainIs( host, ".baz.example.net" )
    ) {
        // Requested domain matches, let's use the proxy.
        ProxyConfig = "PROXY " + proxy_spec;
    } // end if

    return ProxyConfig;

} // end FindProxyForURL()
share|improve this answer
add comment

Check out FoxyProxy there is an option to add in proxies and use them on a certain set of domains.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.