Skip to main content

An HTTP proxy server to automatically authenticate through an NTLM proxy

Project description

Chat on Gitter Chat on Matrix

Px

An HTTP(s) proxy server that allows applications to authenticate through an NTLM or Kerberos proxy server, typically used in corporate deployments, without having to deal with the actual handshake. Px leverages Windows SSPI or single sign-on and automatically authenticates using the currently logged in Windows user account. It is also possible to run Px on Windows, Linux and MacOS without single sign-on by configuring the domain, username and password to authenticate with.

Px uses libcurl and supports all the authentication mechanisms supported by libcurl.

Requires Python ≥ 3.10

Installation

python -m pip install px-proxy

On Windows, scoop can also be used: scoop install px

Prebuilt binaries and offline wheel packages are available on the releases page. See the installation guide for all options including Docker, WinSW, and source installs.

Quick start

# Run with an upstream proxy
px --proxy=proxyserver.com:8080

# Run with a PAC file
px --pac=http://example.com/proxy.pac

# Run with verbose logging
px --proxy=proxyserver.com:80 --verbose

# Save configuration to px.ini
px --proxy=proxyserver.com:8080 --save

# Test connectivity
px --test

Configuration

Px can be configured via command-line flags, environment variables (PX_*), dotenv files, or px.ini. See px --help for all options.

Common options:

Flag Description
--proxy=HOST:PORT Upstream proxy server(s), comma-separated
--pac=URL PAC file URL or local path
--port=NUM Listening port (default 3128)
--gateway Allow remote clients
--hostonly Restrict to local interfaces
--noproxy=LIST Hosts/IPs that bypass the upstream proxy
--auth=TYPE Force upstream auth type (ANY, NTLM, NEGOTIATE, BASIC, NONE)
--username=DOMAIN\user Username for upstream proxy auth
--log=4 Log to stdout (verbose mode)

Full reference: Configuration

Credentials

If SSPI is not available, provide --username in domain\username format. The password is stored in the system keyring:

px --username=domain\username --password

PX_PASSWORD can be used as an alternative when keyring is not available.

See the usage guide for platform-specific keyring setup and client authentication.

Documentation

User guides
Installation pip, wheels, binary, Docker, scoop, WinSW, uninstallation
Usage Credentials, client auth, examples, dependencies, limitations
Configuration All CLI flags, environment variables, INI keys, auth types
Developer guides
Architecture Runtime model, package layout, data flow, state management
Build Build system, pyproject.toml, GitHub Actions, wheels, Nuitka, Docker
Testing Test suite layout, running tests, fixtures, coverage
Reference
Changelog Release history

Development

Requires uv.

git clone https://github.com/genotrance/px.git
cd px
make install
make test
Target Description
make install Create venv, install dependencies, install pre-commit hooks
make check Run linters (ruff) and type checking (mypy)
make test Run tests with coverage
make build Build sdist and wheel
make clean Remove build artifacts

Contributing

Bug reports and pull requests are welcome at https://github.com/genotrance/px/issues.

  1. Fork and clone the repository.
  2. make install to set up the venv and pre-commit hooks.
  3. Create a feature branch, make changes, add tests in tests/.
  4. make check && make test — all checks must pass.
  5. Open a pull request.

Feedback

Px is definitely a work in progress and any feedback or suggestions are welcome. It is hosted on GitHub with an MIT license so issues, forks and PRs are most appreciated. Join us on the discussion board, Gitter or Matrix to chat about Px.

Credits

Thank you to all contributors for their PRs and all issue submitters.

Px is based on code from all over the internet and acknowledges innumerable sources.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

px_proxy-0.10.3.tar.gz (43.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

px_proxy-0.10.3-py3-none-any.whl (35.7 kB view details)

Uploaded Python 3

File details

Details for the file px_proxy-0.10.3.tar.gz.

File metadata

  • Download URL: px_proxy-0.10.3.tar.gz
  • Upload date:
  • Size: 43.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for px_proxy-0.10.3.tar.gz
Algorithm Hash digest
SHA256 c61a16c0e42076ef9f4d2890a951fb1946891e7ba75e631766b7aa35ef86e178
MD5 816c8f95ec5c7fc50b53c64c12e39232
BLAKE2b-256 8628adba5011f930aa95557664ee6da2a17eae9e2a13caa14c6134f615e75761

See more details on using hashes here.

Provenance

The following attestation bundles were made for px_proxy-0.10.3.tar.gz:

Publisher: build.yml on genotrance/px

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file px_proxy-0.10.3-py3-none-any.whl.

File metadata

  • Download URL: px_proxy-0.10.3-py3-none-any.whl
  • Upload date:
  • Size: 35.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for px_proxy-0.10.3-py3-none-any.whl
Algorithm Hash digest
SHA256 60f5673c791bf96ff6fe862bf4467f07546d8d56f8aeaa0303d144b2e5a0f510
MD5 0df1a2033df89fa4c65284f2f20d414f
BLAKE2b-256 7e3c548c0dad83fdbfe3526ba0995dd06f78da61c580fe1ab454f2aa94f1347a

See more details on using hashes here.

Provenance

The following attestation bundles were made for px_proxy-0.10.3-py3-none-any.whl:

Publisher: build.yml on genotrance/px

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page