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:
- Set your default proxy configuration
- Add rules to define specific routing behavior
- Generate your PAC script
- Test your script in the Tester
- 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 connectionPROXY host:port- Single HTTP proxyPROXY host1:port; PROXY host2:port- Fallback proxiesSOCKS host:port- SOCKS proxyHTTPS 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