Skip to content

Cross-platform proxy resolution library written in C.

License

Notifications You must be signed in to change notification settings

nmoinvaz/proxyres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

proxyres - proxy resolution library in C

CodeFactor codecov License: MIT

Cross-platform proxy resolution with support for Linux, macOS, & Windows.

Read the Documentation

Features

  • Read the user's proxy configuration from the operating system.
  • Execute a PAC script using JavaScriptCore or Windows Script Host.
  • Get the proxies for a URL asynchronously using WinHTTP, ProxyConfiguration, and CFNetwork.
    • Or with a fallback proxy resolver featuring:
      • Support for WPAD using DHCP and DNS.
      • Support for PAC file execution using system scripting libraries.
      • Support for downloading PAC scripts using HTTPS with curl.
  • Example command line utility.

Supported Platforms

  • Windows XP+, RT (UWP)
  • Ubuntu 18
  • macOS 10.13

Example

Source code examples can be found in the docs for each class or in the command line test application proxycli.

Build

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

Options

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

History & Motivation

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.

Resources