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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like my Mac to use specific proxy auto-config settings when inside the office LAN but not use a proxy when connected to any other network.

How can I configure it in such a way? I suspect there should be a way to add a conditional in the pac file javascript to check whether the computer is currently inside the office LAN - but how?

My current pac file is something like this:

var normal = "DIRECT", officeproxy = "PROXY";

function FindProxyForURL(url, host) {
    if(/^https:\/\/\//i.test(url)) {
        return officeproxy; 
    return normal;


share|improve this question
up vote 0 down vote accepted

There's no way to check what network the computer is connected to per se; however, one can use different alternative methods of checking local hosts to attempt to guess the network:

myIpAddress() === officeip

or such.

share|improve this answer

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.