Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

0xced
Copy link

@0xced 0xced commented Jun 14, 2022

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. 😇

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:

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

Since the [request URL scheme is not known][1], 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. 😇

[1]: golang/go#28940
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant