Use path in PAC files

Hi Forum,
Is there any way to match the whole URL in the PAC file

I would like to bypass all connections to www.abc.de
Except for www.abc.de/123/sdfg* (wildcard for whatever comes next)

Is there any way of doing this maybe with a variable based on regex?
Thanks
Jeppe

You an use the shExpMatch function.

if (shExpMatch(url, “http://abcdomain.com/folder/*”))
return “DIRECT”;

Hi Gordon,
Thanks for your reply. Do you know if a longer path is supported and maybe even a query string:
if (shExpMatch(url, “http://abcdomain.com/folder/folder/folder/folder/*”))
or
if (shExpMatch(url, “http://abcdomain.com/folder/folder/folder/folder?client_id=xyz*”))
Regards
Jeppe

You can test PAC file logic here - https://app.thorsen.pm/proxyforurl

1 Like

By default recent browsers strip of path and stuff (for https URLs) before sending it to pac file.

If you need that also for https you would need to explicitly enable that in the browser.

As far as i know:
In Chrome, you can disable this by setting PacHttpsUrlStrippingEnabled to false
In Firefox the preference is network.proxy.autoconfig_url.include_path