Skip to content

Alpaca doesn't detect when the system's PAC URL changes #91

Description

@samuong

Currently, the PAC URL is read from the system settings before downloading the PAC file. This is done by calling out to a subprocess (gsettings or networksetup on Linux and macOS - but for Windows this is not yet implemented) and reading stdout. It takes around 50-60ms on my M1 MacBook Pro, which is too slow to do on every outgoing request. But if we don't check this value frequently, the configured PAC URL can change and Alpaca won't notice.

We can make the findPACURL() function faster by calling the native system libraries from Cgo. This will then allow us to check the PAC URL before Alpaca forwards each outgoing request.

Linux (GNOME)

https://wiki.gnome.org/DevGnomeOrg/Gnome3PortingGuide/ProxyConfiguration
https://docs.gtk.org/gio/class.Settings.html

macOS

https://developer.apple.com/documentation/systemconfiguration/1517088-scdynamicstorecopyproxies

Windows

https://docs.microsoft.com/en-us/windows/win32/api/winhttp/nf-winhttp-winhttpgetieproxyconfigforcurrentuser

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions