pacproxy icon indicating copy to clipboard operation
pacproxy copied to clipboard

Add option (-s) to explicitly specify the URL scheme

Open 0xced opened this issue 3 years ago • 0 comments

Explicitly specifying the URL scheme might be required depending on how the PAC file is written. For example, if the script returns a different value based on the URL scheme then passing the full URL to the FindProxyForURL method might be required.

Here's an example of such a (real life) PAC script:

if ((url.substring(0,5) != "http:") && (url.substring(0,6) != "https:"))
return "DIRECT";

Since the request URL scheme is not known, passing it explicitly through a command line option solves this issue.

The README has also been updated to reflect the intended usage of the new -s option.

Please bear in mind that this is the first time I ever write some go code. 😇

0xced avatar Jun 14 '22 22:06 0xced