Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to apply proxy settings to a particular host only (e.g., in Mac OS X. How can I do it?

In System Preferences there are only options for bypassing proxy settings for particular hosts.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

You can use the following proxy.pac file to send all traffic to through the proxy while still going directly to all other hosts:

function FindProxyForURL(url, host) {

    // via proxy
    if (shExpMatch(host,"*")) {
        return PROXY;
    // Everything else directly!
    return "DIRECT";
  1. Save this script as proxy.pac(or any other name you like) on a web server. This can be a local web server (http://localhost/proxy.pac). This is required as of OSX Lion.
  2. Go to the System Preferences.
  3. Select Network.
  4. Select the network you want to change (i.e. "WiFi").
  5. Click Advanced... button.
  6. Click Proxies tab
  7. Check [x] Automatic Proxy-Configuration.
  8. In the URL: field, type in the URL to the file you've created in step 1., for example: http://localhost/proxy.pac. (note: local paths will not work in modern OSX)
  9. Click Save and Apply

Voila! Your own proxy-configuration

For more information on the format of the proxy.pac file have a look at as starting point.

share|improve this answer
Thanks, this is exactly what I was looking for. – Tushar Mathur Mar 13 '13 at 6:08

Your Answer


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.