Documentation

Complete guide to using the PAC Script Generator

Getting Started

The PAC Script Generator helps you create proxy configuration scripts through a visual interface. Follow these steps to get started:

  1. Set your default proxy configuration
  2. Add rules to define specific routing behavior
  3. Generate your PAC script
  4. Test your script in the Tester
  5. Download or share your script

Rule Types

Host Rule

Matches a specific hostname exactly. Use this for direct host-to-proxy mappings.

Example: example.com

URL Pattern Rule

Matches URLs using wildcard patterns. The * character matches any sequence of characters.

Example: *.google.com/*

IP Range Rule

Matches IP addresses within a specific range using subnet masks. Useful for internal network routing.

Example: 192.168.1.0 with mask 255.255.255.0

DNS Domain Rule

Matches a domain and all its subdomains. The domain should start with a dot.

Example: .company.com

Proxy Format

Proxy values can be specified in the following formats:

  • DIRECT - No proxy, direct connection
  • PROXY host:port - Single HTTP proxy
  • PROXY host1:port; PROXY host2:port - Fallback proxies
  • SOCKS host:port - SOCKS proxy
  • HTTPS host:port - HTTPS proxy

Rule Priority

Rules are evaluated in order from top to bottom. The first matching rule determines the proxy. Use drag-and-drop to reorder rules.

PAC Functions

dnsResolve(host)

Resolves the hostname to an IP address.
Example: dnsResolve("example.com") returns "93.184.216.34"

isInNet(host, pattern, mask)

Checks if an IP address is within a specific subnet.
Example: isInNet("192.168.1.50", "192.168.1.0", "255.255.255.0") returns true

shExpMatch(str, pattern)

Performs wildcard pattern matching.
Example: shExpMatch(url, "*.google.com/*")

dnsDomainIs(host, domain)

Checks if the host is within a specific domain.
Example: dnsDomainIs(host, ".example.com")

isPlainHostName(host)

Returns true if the hostname has no dots (is not a FQDN).
Example: isPlainHostName("localhost") returns true

Sharing Scripts

Client-Side Sharing

Encodes the script in the URL fragment. No server storage, completely private. Note: URLs longer than 2KB may not work in all browsers.

Server-Side Sharing

Stores the script on the server for 30 days. Generates short URLs and provides a direct PAC URL for browser configuration. Optionally use custom IDs (4-32 alphanumeric characters).

Configuration Management

Save your configurations locally in your browser. Configurations include all rules, proxy settings, and custom functions. Use the Load Configuration feature to quickly switch between different setups.

Templates

Quick start templates provide pre-configured rule sets for common scenarios:

  • Corporate Network - Internal/external traffic routing
  • Dual Proxy - Primary/failover proxy configuration
  • Geographical Routing - Region-based proxy selection
  • Common Direct Sites - Bypass proxy for popular services

Best Practices

  • Test your PAC script before deploying to production
  • Order rules from most specific to least specific
  • Use templates as starting points for common scenarios
  • Save configurations for different network environments
  • Keep your PAC scripts as simple as possible