Proxy pac is just a JS file.

It’s quiet tedious to troubleshoot, however. Below is an example with several key features:

  
function FindProxyForURL(url, host) {

// If netbois name

if (isPlainHostName(host))
  
{return 'DIRECT';}

// change to lower case  because javascript is the best
  
host = host.toLowerCase();

// If regex match
  
if
  
(
	  
shExpMatch(host, "build.*") ||
	  
shExpMatch(host, "stage.*") ||
	  
shExpMatch(host, "sts.*") ||
	  
shExpMatch(host, "a.evexchange*") ||
	  
shExpMatch(host, "\*evfile\*"))
  
)
  
{return 'DIRECT';}

// If URL is
  
if
  
(
	  
dnsDomainIs(host, "test") ||
	  
dnsDomainIs(host, "dev.domain.com") ||
	  
dnsDomainIs(host, "apps.test.com") ||
	  
dnsDomainIs(host, "Intranet") ||
	  
dnsDomainIs(host, "corpapps") ||
	  
dnsDomainIs(host, "devtest"))
  
)
  
{return 'DIRECT';}

// Internal addresses
  
//if
  
//(
  
// isInNet(dnsResolve(host), "10.0.0.0", "255.0.0.0") ||
  
// isInNet(dnsResolve(host), "172.16.0.0", "255.255.0.0"))
  
//)
  
//{return 'DIRECT';}

// If within BC WAN, else home
  
if (isResolvable("internal.url.int.company.pri"))
  
{return "PROXY proxyserver:3128";}

// Else
  
{return 'DIRECT';}}