Skip to main content

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. It automatically uses winloop on Windows or uvloop on Linux and macOS when available; use --event-loop=asyncio to select the standard Python event loop. After repeated upstream authentication failures, Px also retries a blocked proxy periodically instead of sending every request into another 407 response.

Requires Python ≥ 3.10

Installation

pip install px-proxy
uv tool install px-proxy
pipx install px-proxy

On Windows, Winget and Scoop can also be used:

winget install genotrance.px
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)
--event-loop=MODE Select automatic or standard-asyncio event loop
--authretry=SECONDS Retry an upstream proxy blocked by repeated 407s (default 600)
--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, Winget, 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 benchmark Run concurrency benchmarks
make test-large-data Run large data transfer reliability tests
make docker Build local Docker images (full and mini)
make test-kerberos Build KDC images and run Kerberos integration tests
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.

Metadata

Release files for px-proxy 0.13.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for px-proxy 0.13.2
File Size Uploaded Provenance Actions
px_proxy-0.13.2.tar.gz 138.0 kB With provenance Details for px_proxy-0.13.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for px-proxy 0.13.2
File Interpreter ABI Platform Actions
px_proxy-0.13.2-py3-none-any.whl Python 3 none any Details for px_proxy-0.13.2-py3-none-any.whl

Total release size: 199.1 kB

Release files / px_proxy-0.13.2.tar.gz

Download URL px_proxy-0.13.2.tar.gz
Size 138.0 kB
Tags Source
SHA-256 checksum
How to use checksums
940eafc6034202f2e70a33efedcbb77c5f1e7880cc2b881344fa0a79b50b8d95
BLAKE2b-256 checksum
How to use checksums
87ffa4e28197f274af7912642fe91c175e2d09c0318b9e1aec6cc8281d8cf39c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / px_proxy-0.13.2-py3-none-any.whl

Download URL px_proxy-0.13.2-py3-none-any.whl
Size 61.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9236cc5f96ded5db9a479b1f1932af61d54c746d84c1f5445dac14efeb71e050
BLAKE2b-256 checksum
How to use checksums
f5d8c1cd826e7dfda752b29c383859a1df6544b5d4d2b558664e489fb1c27451
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for px-proxy 0.13.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for px_proxy-0.13.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page