Skip to main content

⚡ High-performance Python proxy server with authentication, load balancing, caching, and multi-protocol support

Project description

ProxyCraft

ProxyCraft is the easiest and quickest way to deploy a web proxy.


License Python Build Status Version

HTTP HTTPS WebSocket SOCKS5 TCP/UDP


✨ Features

ProxyCraft offers many features:

  • 🔒 Protocol Support: Handle HTTP, HTTPS, WebSockets, TCP/UDP, and SOCKS proxies
  • 🔐 Authentication: Support for various auth methods (Basic, Digest, NTLM, Kerberos)
  • 🔄 Connection Pooling: Efficient reuse of connections to improve performance
  • ⚖️ Load Balancing: Distribute traffic across multiple proxies
  • 🏥 Health Checking: Automatic detection and recovery from failed proxies
  • 💾 Caching: Store and reuse responses for identical requests
  • 🔄 Retry Mechanisms: Automatically retry failed requests
  • 🔧 Circuit Breaking: Prevent cascading failures
  • 📊 Metrics Collection: Track proxy performance, latency, error rates
  • 🔐 TLS/SSL Termination: Handle encryption/decryption
  • 🌍 IP Rotation: Change public IP addresses for scraping
  • 🎯 Geo-targeting: Route requests through proxies in specific locations

🚀 Quick Start

Installation

pip install proxycraft

Or with uv:

uv add proxycraft

Basic Usage

from proxycraft import ProxyCraft

if __name__ == "__main__":
    proxycraft: ProxyCraft = ProxyCraft(config_file='proxy.json')
    proxycraft.serve(host='0.0.0.0', port=8091)

📋 Configuration Example

{
  "version": "1.0",
  "name": "Simple example",
  "endpoints": [
    {
      "prefix": "/",
      "match": "**/*",
      "backends": {
        "https": {
          "url": "https://jsonplaceholder.typicode.com/posts"
        }
      },
      "upstream": {
        "proxy": {
          "enabled": true
        }
      }
    }
  ]
}

🐳 Docker Usage

docker build -t proxycraft -f dockerfiles/proxycraft.Dockerfile .
docker run  -p 8080:8080 proxycraft

Project structure

proxycraft/
├── app/              # ASGI application composition root
├── features/         # Capability-owned modules (routing, backends, middleware, …)
└── shared/           # Cross-cutting infrastructure (logging, connection pooling)

See docs/architecture.md and SPECS.md for details.

Development

Install just and uv, then:

just install
just test
just lint

Build a release (requires VERSION):

VERSION=1.0.0 just build

Run a subset of tests:

just test tests/path/to/test_file.py

List all available commands:

just

📄 License

MIT

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

proxycraft-2.1.0.tar.gz (199.4 kB view details)

Uploaded Source

Built Distribution

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

proxycraft-2.1.0-py3-none-any.whl (100.2 kB view details)

Uploaded Python 3

File details

Details for the file proxycraft-2.1.0.tar.gz.

File metadata

  • Download URL: proxycraft-2.1.0.tar.gz
  • Upload date:
  • Size: 199.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for proxycraft-2.1.0.tar.gz
Algorithm Hash digest
SHA256 f43c6762aab740bf85504961773e7f31133f422064985fbbae0018f724a2faf5
MD5 37e5954af90857b5c661869e8e2305f6
BLAKE2b-256 1c6e37e6a17e26cfdc5cf7fb316619e24869d775d1c0030bf99a1a356e05d2ca

See more details on using hashes here.

File details

Details for the file proxycraft-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: proxycraft-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 100.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for proxycraft-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ebcc643641d9f90bb2c4c555c87ff729bec0d8fa42ce6c437b61ad80ed8ce85
MD5 f964f3242545ffde0d59118d04da4ca1
BLAKE2b-256 9a823325a877b2329768b481c5faef18c6ab3365b0fe3a9811ac221212b2c331

See more details on using hashes here.

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