samuong / alpaca

A local HTTP proxy for command-line tools. Supports PAC scripts and NTLM authentication.
Apache License 2.0
184 stars 31 forks source link

Add basic support for loading pac file from file:// URI #13

Closed k-f closed 4 years ago

k-f commented 5 years ago

A quick attempt at file:// support per #12

samuong commented 5 years ago

Also, are you able to add a warning message (see issue #12 for context)? I'd suggest something like the following, but am open to word-smithing:

Warning: The PAC URL is served over file://, which is supported by Alpaca, but not by Windows and macOS. Be careful if you configure your system settings to use the same URL.

samuong commented 5 years ago

Oh and finally, can you add a test for this? Just a function that creates a temp file with a simple FindProxyForURL pattern that just returns a fixed string like "PROXY proxy.example.com:80".. Then the test should check that findProxyForRequest returns a URL with the right host/port (i.e. proxy.exmaple.com:80).

k-f commented 5 years ago

@samuong thanks, changes done