Skip to main content

Interactive HTTP/HTTPS debugging proxy with runtime policies and terminal UI.

Project description

proxyscope

proxyscope is an interactive HTTP/HTTPS debugging proxy with a terminal UI.
It supports request/response inspection, response editing, replay, and both static and editor-based policy rules.

Features

  • HTTP forward proxy and HTTPS via CONNECT
  • Optional TLS interception (MITM) with a local CA
  • Runtime control directly in the TUI
  • Request/response log with details, filters, export (json, har), and session persistence
  • Policy type open_editor (manually edit responses)
  • Policy type static_response (serve static responses)

Requirements

  • Python >=3.13
  • Poetry 2.x (for development)

Installation

From the repository (recommended for development):

git clone <repo-url>
cd proxyscope
poetry install

Install from PyPI:

pip install proxyscope

Start

Default start:

poetry run proxyscope --host 127.0.0.1 --port 8080

With a static configuration file:

poetry run proxyscope --config ./runtime-config.json

Without TUI:

poetry run proxyscope --no-ui

Available CLI options:

  • --host <ip-or-hostname>
  • --port <port>
  • --config <path>
  • --mitm on|off
  • --certs-dir <path>
  • --no-ui

Use Proxy With A Client

Example with curl:

curl -x http://127.0.0.1:8080 http://httpbin.org/get
curl -x http://127.0.0.1:8080 https://httpbin.org/get

Screenshots

Overview

Runtime overview

Request Detail

Request detail view

Policies Sidebar

Policies sidebar

Regenerate screenshots:

poetry run python scripts/generate_readme_screenshots.py

Runtime Commands (TUI)

  • help, ?
  • clear
  • sites
  • loglevel <DEBUG|INFO|WARNING|ERROR>
  • filter [show|clear|host|method|status|text] ...
  • find <text>
  • find clear
  • export <json|har> <path>
  • session <save|load> <path>
  • mitm [show|on|off|certs-dir <path>]
  • whitelist [show|add|remove|clear] ...
  • cache [show|on|off|toggle]
  • config [show|save [path]|reload]
  • policy [show|add-editor|add-editor-prefix|remove-editor|clear-editor|add-static|add-static-prefix|set-priority|edit|remove|enable|disable] ...
  • quit, exit, q

Keyboard Shortcuts (TUI)

  • Tab / Shift+Tab: Cycle focus through panes
  • Enter: Open request detail or execute the current command input
  • Shift+S: Toggle sidebar (Sites)
  • Shift+P: Open Policies sidebar
  • Shift+B: Go back in the current view
  • Shift+M: Create an editor policy from the selected request
  • Shift+R: Edit and resend the selected request
  • Shift+A / Shift+U: Add/remove selected site to/from whitelist
  • Shift+D / Shift+E: Disable/enable selected policy
  • Shift+I: Open selected policy in external editor
  • Shift+X: Remove selected policy

Static Configuration (runtime-config.json)

The file can be loaded at startup via --config.
If a config_path is attached, many runtime changes are automatically persisted to this file.

Example:

{
  "log_level": "INFO",
  "log_whitelist": [
    "api.example.com",
    "service.internal"
  ],
  "cache_invalidation_enabled": true,
  "mitm_enabled": true,
  "mitm_certs_dir": "certs",
  "policies": [
    {
      "name": "health-static",
      "enabled": true,
      "priority": 20,
      "action": {
        "type": "static_response",
        "status_code": 200,
        "reason": "OK",
        "headers": {
          "Content-Type": "application/json",
          "Cache-Control": "no-store"
        },
        "body": "{\"status\":\"ok\",\"source\":\"proxyscope\"}"
      },
      "match": {
        "methods": ["GET"],
        "url_exact": "https://service.internal/health"
      }
    },
    {
      "name": "edit-login-response",
      "enabled": true,
      "priority": 10,
      "action": {
        "type": "open_editor"
      },
      "match": {
        "methods": ["POST"],
        "url_prefix": "https://api.example.com/v1/login"
      }
    }
  ]
}

Start with file:

poetry run proxyscope --config ./runtime-config.json

MITM / Certificates

On startup, proxyscope automatically creates missing CA files under <mitm_certs_dir>/ca.
For HTTPS interception, the root certificate <mitm_certs_dir>/ca/mitm-ca.crt must be trusted by your client/browser.

Tests

poetry run python -m unittest discover -s tests -p "test_*.py" -v

License

MIT, see LICENSE.

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

proxyscope-0.1.2a1.tar.gz (51.5 kB view details)

Uploaded Source

Built Distribution

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

proxyscope-0.1.2a1-py3-none-any.whl (71.2 kB view details)

Uploaded Python 3

File details

Details for the file proxyscope-0.1.2a1.tar.gz.

File metadata

  • Download URL: proxyscope-0.1.2a1.tar.gz
  • Upload date:
  • Size: 51.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.12 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for proxyscope-0.1.2a1.tar.gz
Algorithm Hash digest
SHA256 857333858a8c3abfb85d03871bd567cf5a42bd21f554a8ca51078adfb336ba87
MD5 bfa6e82bb7c271b93a01fc582f2d1bc4
BLAKE2b-256 3288b9994dd05f46b1dcb4d6ced7aea7aa9e295843a0d1ce6a11a4070fde0238

See more details on using hashes here.

File details

Details for the file proxyscope-0.1.2a1-py3-none-any.whl.

File metadata

  • Download URL: proxyscope-0.1.2a1-py3-none-any.whl
  • Upload date:
  • Size: 71.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.12 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for proxyscope-0.1.2a1-py3-none-any.whl
Algorithm Hash digest
SHA256 994443b223c64314a7a3565ae9c2891f65912e2221c685fdf0ece0746896a57b
MD5 12b3bb48698f76baa5c67be6d7826de5
BLAKE2b-256 2c3cc830b729e968d85e106157943e057a8b0652b16006898c0c54a4fb0513b4

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