Cross-platform proxy resolution with support for Linux, macOS, & Windows.
- Read the user's proxy configuration from the operating system.
- Execute a PAC script using
JavaScriptCore
orWindows Script Host
. - Get the proxies for a URL asynchronously using
WinHTTP
,ProxyConfiguration
, andCFNetwork
.- Or with a fallback proxy resolver featuring:
- Support for
WPAD
usingDHCP
andDNS
. - Support for PAC file execution using system scripting libraries.
- Support for downloading PAC scripts using HTTPS with curl.
- Support for
- Or with a fallback proxy resolver featuring:
- Example command line utility.
- Windows XP+, RT (UWP)
- Ubuntu 18
- macOS 10.13
Source code examples can be found in the docs for each class or in the command line test application proxycli.
Use CMake to generate project and solution files for your environment:
cmake -S . -B build
cmake --build build
To run CMake tests use the following command:
ctest --verbose -C Debug
Name | Description | Default |
---|---|---|
PROXYRES_CURL | Enables downloading PAC scripts using curl. Without this option set, PAC scripts will only be downloaded using HTTP 1.0. | OFF |
PROXYRES_EXECUTE | Enables support for PAC script execution. Required on Linux due to the lack of a system level proxy resolver. | ON |
PROXYRES_BUILD_CLI | Build command line utility. | ON |
PROXYRES_BUILD_TESTS | Build Googletest unit tests project. | ON |
PROXYRES_CODE_COVERAGE | Build for code coverage. | OFF |
Portions of the code for this library started many years ago as part of a custom HTTP/HTTPS stack we developed at Solid State Networks. Recently we made the decision to switch over to libcurl
but realized that we still needed to retain our own proxy resolution code. We investigated using libproxy
, however it did not allow us to statically link the library for closed source commerical purposes. In the end we decided to separate parts of our proxy implementation to its own library.