Proxy Auto-Configuration (PAC) Syntax Builder & Sandbox Evaluator

Design, validate, and debug enterprise Proxy Auto-Configuration (PAC) scripts and FindProxyForURL() logic. Test IP subnets, CIDR blocks, regex URL rules, and fallback proxy chains in an isolated client-side JavaScript sandbox.Documentation & FAQs ↓

Proxy Auto-Configuration (PAC) Syntax Builder & Sandbox Evaluator — Interactive Console
Runs locally in your browser • Instant output

HTTP Proxy PAC File Syntax Builder & Sandbox URL Tester

Standard Netscape FindProxyForURL(url, host) generator, RFC1918 subnet rules & interactive regex sandbox.

Primary Proxy Node

Failover Routing

Direct Bypass Exceptions

Interactive PAC Sandbox URL Evaluator

FindProxyForURL(url, host) Generated JavaScript
/**
 * Proxy Auto-Configuration (PAC) Script
 * Generated via AnshuTechy PAC Builder
 */
function FindProxyForURL(url, host) {
  // Convert host to lowercase for consistent matching
  host = host.toLowerCase();

  // 1. Plain hostnames without dots (e.g. "http://intranet/") route direct
  if (isPlainHostName(host)) {
    return "DIRECT";
  }

  // 2. Localhost and loopback interfaces route direct
  if (host === "localhost" || host === "127.0.0.1" || host === "::1") {
    return "DIRECT";
  }

  // 3. Explicit domain wildcard bypass list
  if (shExpMatch(host, "*.internal")) {
    return "DIRECT";
  }
  if (shExpMatch(host, "*.local")) {
    return "DIRECT";
  }
  if (shExpMatch(host, "*.company-dev.net")) {
    return "DIRECT";
  }

  // 4. RFC1918 Private IP Subnets (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16)
  var resolvedIp = dnsResolve(host);
  if (resolvedIp) {
    if (isInNet(resolvedIp, "10.0.0.0", "255.0.0.0") ||
        isInNet(resolvedIp, "172.16.0.0", "255.240.0.0") ||
        isInNet(resolvedIp, "192.168.0.0", "255.255.0.0") ||
        isInNet(resolvedIp, "127.0.0.0", "255.0.0.0")) {
      return "DIRECT";
    }
  }

  // 5. Default corporate gateway proxy with failover
  return "PROXY proxy.corp.internal:8080; DIRECT";
}
Advertisement

Step-by-Step Instructions

4 Steps to Completion
1Phase 1

Add your routing rules using the visual builder or write custom JavaScript inside the FindProxyForURL editor.

2Phase 2

Specify primary proxy servers, secondary fallback proxies, and direct internet bypass conditions.

3Phase 3

Enter test destination URLs (e.g., https://internal.corp.local, https://github.com) and mock client IP addresses.

4Phase 4

Click 'Evaluate PAC' to see the exact proxy string returned, execution path traced, and export the ready-to-deploy .pac file.

Practical Use Cases & Real-World Scenarios

Enterprise Network & SASE Administration
Deploy corporate proxy PAC files to route sensitive intranet traffic directly while filtering public web traffic through Zscaler, Cloudflare One, or BlueCoat.
Debugging Remote Work VPN Split-Tunneling
Diagnose why specific company domains or SaaS applications fail to route through corporate web gateways when employees connect via home Wi-Fi.
WPAD & Browser Configuration Deployment
Test wpad.dat scripts before publishing to Active Directory Group Policy (GPO) or DHCP Option 252 servers.
Related Editorial Guide on AnshuTechy15 Best Free Proxy Server Websites in 2026
Read Tutorial →
Share With Your Community

Found this tool helpful? Share it with colleagues & friends:

100% free, private in-browser utility with zero server uploads.