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.

I want to apply proxy settings to a particular host only eg. www.apple.com in OSx. How can I do it?

In mac there are only options for by passing proxy settings.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You can use the following proxy.pac-file to sen all traffic to apple.com through the proxy 1.2.3.4 while still going directly to all other hosts:

function FindProxyForURL(url, host) {
    PROXY = "PROXY 1.2.3.4"

    // Apple.com via proxy
    if (shExpMatch(host,"*.apple.com")) {
        return PROXY;
    }
    // Everything else directly!
    return "DIRECT";
}

Save this script as proxy.pac(Or any other name you like) somewhere in the filesystem.

Then go to the Network-part of the Systempreferences and go to the Further Options-Dailog of your Connection. There you can select the Proxies-Tab where you select the second entry on the left side ('Automatic Proxy-Configuration`) and select the proxy.pac-File you just created.

Voila! Your own proxy-configuration

For more information on the format of the proxy.pac-file have a look at http://de.wikipedia.org/wiki/Proxy_Auto-Config 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

 
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.