genotrance/px

By genotrance

Updated about 17 hours ago

An HTTP proxy server to automatically authenticate through an NTLM proxy

Image
Networking
0

5.3K

genotrance/px repository overview

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:

FlagDescription
--proxy=HOST:PORTUpstream proxy server(s), comma-separated
--pac=URLPAC file URL or local path
--port=NUMListening port (default 3128)
--gatewayAllow remote clients
--hostonlyRestrict to local interfaces
--noproxy=LISTHosts/IPs that bypass the upstream proxy
--auth=TYPEForce upstream auth type (ANY, NTLM, NEGOTIATE, BASIC, NONE)
--username=DOMAIN\userUsername for upstream proxy auth
--log=4Log 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
Installationpip, wheels, binary, Docker, scoop, WinSW, uninstallation
UsageCredentials, client auth, examples, dependencies, limitations
ConfigurationAll CLI flags, environment variables, INI keys, auth types
Developer guides
ArchitectureRuntime model, package layout, data flow, state management
BuildBuild system, pyproject.toml, GitHub Actions, wheels, Nuitka, Docker
TestingTest suite layout, running tests, fixtures, coverage
Reference
ChangelogRelease history

Development

Requires uv.

git clone https://github.com/genotrance/px.git
cd px
make install
make test
TargetDescription
make installCreate venv, install dependencies, install pre-commit hooks
make checkRun linters (ruff) and type checking (mypy)
make testRun tests with coverage
make buildBuild sdist and wheel
make cleanRemove 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.

Tag summary

Content type

Image

Digest

sha256:cbcc54940

Size

59.6 MB

Last updated

about 17 hours ago

docker pull genotrance/px