Writing automatic configuration script, PAC file

In the PAC file, describe the processing condition for specifying the proxy server to use based on the information such as the URL of the access destination. Within script processing, it returns the destination(URL or IP address) and port number of the proxy server matching the condition such as the host name of the URL and the IP address.

PAC file sample

function FindProxyForURL(url, host){
  if(isPlainHostName(host)){
    return "DIRECT";
  } else {
    if (shExpMatch(url, "http://www.bing.com/")){
      return "PROXY www.bing-proxy.com:6060";
    } else if (shExpMatch(url, "http://www.microsoft.com/")){
      return "PROXY www.microsoft-proxy.com:7070";
    } else {
      return "PROXY www.other-proxy.com:8080"
    }
  }
}