Skip to main content

A simple, chainable HTTP proxy with multithreading support

Project description

SSProxy

A simple, stupid, chainable HTTP proxy with multithreading support, written in Python.

Features

  • Multithreaded - Handles multiple concurrent connections
  • Chainable - Can chain through upstream proxies (with Basic auth support)
  • HTTP CONNECT Support - Tunnels HTTPS traffic through the proxy
  • YAML Configurable - All settings can be configured via config.yaml
  • CLI Overrides - Command-line arguments take precedence over config
  • Colorful Output - Terminal-friendly colored logging for requests/responses

Installation

pip install -e .

Usage

Command Line

# Run with default config (config.yaml)
ssproxy

# Run on custom port
ssproxy -p 8888

# Chain through upstream proxy
ssproxy --upstream proxy.example.com:8080

# Disable colored output
ssproxy --plain

# Show all options
ssproxy --help

Configuration File

Create config.yaml:

host: 127.0.0.1
port: 8080

upstream_proxy:
  enabled: false
  host: 127.0.0.1
  port: 8888
  auth:
    enabled: false
    username: ""
    password: ""

logging:
  enabled: true
  colorful: true
  show_request_body: false
  show_response_body: false

threads:
  max_connections: 100
  timeout: 30

Programmatic Usage

from proxy.config import ProxyConfig
from proxy.server import ProxyServer

config = ProxyConfig()
config.port = 8080

server = ProxyServer(config)
server.start()

How It Works

Client <--> HTTP Proxy <--> Server
                |
                v
          Upstream Proxy (optional)
                |
                v
          Target Server

HTTP Requests

Standard HTTP requests are forwarded directly to the target server:

GET http://example.com/path HTTP/1.1
Host: example.com

CONNECT Tunneling

HTTPS traffic uses the CONNECT method to establish a tunnel:

CONNECT example.com:443 HTTP/1.1
Host: example.com:443

The proxy establishes a TCP tunnel, allowing encrypted traffic to pass through.

CLI Options

Option Description
-c, --config Path to YAML config file
--host Host to bind to
-p, --port Port to bind to
--upstream Upstream proxy (host:port)
--no-upstream Disable upstream proxy
--timeout Connection timeout (seconds)
--max-connections Max concurrent connections
--plain Disable colored output
--quiet Disable logging
--debug Enable debug logging

Testing

# Start proxy
ssproxy -p 8080

# Test with curl
curl http://httpbin.org/ip --proxy http://127.0.0.1:8080

# Test HTTPS tunneling
curl https://example.com --proxy http://127.0.0.1:8080

Requirements

  • Python 3.8+
  • PyYAML

Examples: ssproxy # Run with default config (config.yaml) ssproxy -p 8888 # Run on port 8888 ssproxy --config /path/to/config.yml # Use custom config file ssproxy --no-upstream # Disable upstream proxy chain ssproxy --upstream proxy.example.com:8080 # Set upstream proxy ssproxy --plain # Disable colored output """,

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

ssproxy-0.1.0.1.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

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

ssproxy-0.1.0.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file ssproxy-0.1.0.1.tar.gz.

File metadata

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

File hashes

Hashes for ssproxy-0.1.0.1.tar.gz
Algorithm Hash digest
SHA256 aba98e0fc771ee58e12b5a0a589a94d2b878de8ea8a24490eb6e0b8104fd5a7d
MD5 3e6870f1623d709e4bc4a57aa31b707d
BLAKE2b-256 7cdc86f5466abfc54db1ad315871a19b6f1ad515380a4808b18f1cdb2a9bd189

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssproxy-0.1.0.1.tar.gz:

Publisher: pypi-publish.yml on daedalus/ssproxy

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

File details

Details for the file ssproxy-0.1.0.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for ssproxy-0.1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d6cbd85f7348c4ce806837033d7cdd8b122961d1bdc78d210f77856fd7c0b48d
MD5 5f1e1a7735814b0fb6bd79cb1ebc18ac
BLAKE2b-256 21a42874360512b5337b1c4506144f4fb9d35a51eebb38faf29c9f98dc6e087f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssproxy-0.1.0.1-py3-none-any.whl:

Publisher: pypi-publish.yml on daedalus/ssproxy

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