public enum PacUrlSource extends Enum<PacUrlSource>
The PAC file itself is always evaluated via GraalJS — this enum only controls how the URL to that PAC file is discovered.
// User provides the PAC URL directly:
ProxyResult r = WindowsProxyResolver.resolve(target, PacUrlSource.DIRECT,
"http://wpad.corp.local/wpad.dat");
// PAC URL discovered from Windows Registry (all four hives):
ProxyResult r = WindowsProxyResolver.resolve(target, PacUrlSource.REGISTRY, null);
// PAC URL obtained by running a PowerShell command:
ProxyResult r = WindowsProxyResolver.resolve(target, PacUrlSource.POWERSHELL,
WindowsProxyResolver.DEFAULT_PAC_DISCOVERY_SCRIPT);
| Enum Constant and Description |
|---|
DIRECT
The PAC URL is provided directly by the caller.
|
POWERSHELL
The PAC URL is obtained by running a PowerShell command.
|
REGISTRY
The PAC URL is discovered from the Windows Registry.
|
| Modifier and Type | Method and Description |
|---|---|
static PacUrlSource |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PacUrlSource[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PacUrlSource DIRECT
pacUrlOrScript parameter is the full HTTP URL to the PAC file.public static final PacUrlSource REGISTRY
AutoConfigURL. Falls back to static proxy settings and
WPAD if no PAC URL is found.
The pacUrlOrScript parameter is ignored (may be null).
public static final PacUrlSource POWERSHELL
pacUrlOrScript parameter contains the PowerShell command
whose stdout output is the PAC URL.
If null or empty, the WindowsProxyResolver.DEFAULT_PAC_DISCOVERY_SCRIPT
is used as fallback.
public static PacUrlSource[] values()
for (PacUrlSource c : PacUrlSource.values()) System.out.println(c);
public static PacUrlSource valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2026. All rights reserved.