Skip to content

Repository files navigation

Inspect HTTP Proxy Plus (ihpp)

Go Report Card License: GPL v3

Inspect HTTP Proxy Plus (ihpp) is a powerful, developer-centric reverse HTTP proxy and traffic inspector. It combines a high-performance Go backend with a modern Next.js web interface to provide real-time visibility, persistent history, and request manipulation capabilities for your HTTP traffic.

This project is based on the original project by @signeen (see README.origin.md) but has undergone significant improvements and evolved in a different direction, focusing on multi-proxy management, a rich web UI, and persistent SQLite storage with full-text search.

🚀 Quick Start

The fastest way to run ihpp is using npx:

npx @liyu1981/ihpp

or

# in-memory db mode, best for demo or one time usage
npx @liyu1981/ihpp --in-memory

By default, the web interface will be available at http://localhost:20000.

📖 Documentation

For detailed guides, installation instructions, and feature overviews, visit our Documentation.

✨ Key Features

  • Daemon Mode: Run ihpp in the background as a persistent service.
  • Multi-Proxy Management: Run and manage multiple proxy configurations simultaneously from a single dashboard.
  • Real-time Inspection: Watch HTTP requests and responses flow through in real-time via WebSockets.
  • Persistent History: All proxied traffic is stored in a local SQLite database with Full-Text Search (FTS5) support for lightning-fast searching.
  • Modern Web UI: A polished, responsive dashboard built with React (Next.js) and Tailwind CSS.
  • HTTP Request Builder: Replay, modify, and compose new HTTP requests directly from the UI.
  • OpenAI Stream Support: Specialized renderer for OpenAI-compatible Server-Sent Events (SSE) streams, including support for reasoning fields and proper newline handling.
  • Traffic Analysis: Automatic decompression (gzip/brotli), pretty-printing of common content types (JSON, XML, HTML), and image previews.
  • CURL Export: Quickly copy any captured request as a curl command.
  • Bookmarks: Save important requests for quick access later.
  • Advanced Logging: Configurable log levels and destinations, including file-based logging with automatic rotation.

📦 Installation

Pre-built Binaries

Download the latest version for your platform from the Releases page.

Go Install

go install github.com/liyu1981/inspect-http-proxy-plus@latest

From Source

# Clone the repository
git clone https://github.com/liyu1981/inspect-http-proxy-plus.git
cd inspect-http-proxy-plus

# Build the frontend (requires pnpm)
./scripts/build_and_copy_frontend.sh

# Build the binary
./scripts/build.sh

🛠️ Development

To start the development environment (backend and frontend with hot-reload):

./start_dev.sh

This script will concurrently run the Go backend and the Next.js frontend, allowing for a seamless development experience.

📖 Usage

CLI Flags

  • --daemon, -d: Run in background as a daemon.
  • --db-path <path>: Path to the SQLite database file (default: ~/.ihpp/proxy_logs.db).
  • --in-memory: Use an in-memory database (no persistence, best for one-time usage).
  • --log-level <level>: Set log level (debug, info, warn, error, fatal, panic, disabled).
  • --log-dest <dest>: Log destination: console, null, or a file path. File-based logging includes automatic rotation.
  • --config <path>: Path to a .toml configuration file.

Subcommands

When running as a daemon or interacting with one:

  • ihpp stop: Stop the running daemon gracefully.
  • ihpp status: Show the status of the running daemon (uptime, proxies, etc.).

Common Scenarios

1. Quick Debugging with In-Memory DB

Best for one-time usage when you don't need persistent history.

ihpp --in-memory http://localhost:8080

This starts a proxy at :20003 (default) targeting http://localhost:8080.

2. Running in Background (Daemon Mode)

Start the proxy and keep it running in the background.

ihpp --daemon :3000,http://localhost:8080

Use ihpp status to check if it's running and ihpp stop to terminate it.

3. Managing Multiple Services

Specify multiple proxies directly on the command line.

ihpp :3001,http://localhost:8081 :3002,http://localhost:8082

This manages two proxies simultaneously through a single dashboard at :20000.

3. Persistent Configuration via File

For complex or repetitive setups, use a TOML configuration file.

ihpp --config my_proxies.toml

Example my_proxies.toml:

[server]
api-addr = ":20000"
db-path = "./my_logs.db"

[[proxies]]
name = "Auth Service"
listen = ":8001"
target = "http://localhost:5001"

[[proxies]]
name = "Payment Service"
listen = ":8002"
target = "http://localhost:5002"

Proxy Specification Format

Specify one or more proxies as positional arguments:

# Basic target only (starts at :20003)
ihpp http://localhost:8080

# Specific listen port and target
ihpp :3000,http://localhost:8080

# Multiple proxies
ihpp http://localhost:8080 :3001,http://localhost:9000

By default, the management UI is available at http://localhost:20000.

🤝 Contributing

Contributions are welcome! Please feel free to open an issue or submit a pull request.

📄 License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

About

Simple HTTP proxy that prints out the request/response that go through it for debugging

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages