Skip to content

knktc/tiny-requestbin

Repository files navigation

Tiny RequestBin

English | 简体中文

A lightweight HTTP request inspector and debugging tool written in Go. Tiny RequestBin captures and displays HTTP requests for inspection and debugging purposes.

This project was initially created with Gemini and later modified with GitHub Copilot.

Go Version License

Features

  • 🚀 Lightweight & Fast: Simple implementation with minimal dependencies
  • 🔍 Request Inspection: View detailed information about incoming HTTP requests
  • 🌐 Web UI: Clean interface to browse captured requests
  • 📋 CLI Mode: Option to print requests directly to the terminal
  • 🔒 Local Only: All data stays on your machine, no external services needed

Installation

Option 1: Using Docker (Recommended)

# Pull and run the latest image
docker run -p 8282:8282 knktc/tiny-requestbin

# Or run with custom options
docker run -p 8282:8282 knktc/tiny-requestbin -port 8282 -listen 0.0.0.0 -max 1000

# Using docker-compose
docker-compose up -d

Option 2: Install using go install

go install github.com/knktc/tiny-requestbin@latest

Option 3: Build from source

git clone https://github.com/knktc/tiny-requestbin.git
cd tiny-requestbin
go build

Usage

Start the server with default options:

tiny-requestbin

Command-line Options

  • -port: Port for the server to listen on (default: 8282)
  • -listen: Address to listen on (default: 127.0.0.1)
  • -max: Maximum number of requests to store (default: 100)
  • -cli: Enable CLI mode to print requests to terminal (default: false)

Example with custom options:

tiny-requestbin -port 9000 -listen 0.0.0.0 -max 1000 -cli

How It Works

  1. Start the server using one of the methods above
  2. Send HTTP requests to http://[listen-address]:[port]/any/path
  3. View captured requests in your browser at http://[listen-address]:[port]/
  4. If CLI mode is enabled, requests will also be printed to the terminal

Docker Multi-Architecture Support

The Docker image supports multiple architectures:

  • linux/amd64 (Intel/AMD 64-bit)
  • linux/arm64 (ARM 64-bit, Apple Silicon, etc.)

Multi-architecture images are automatically built and published via GitHub Actions when tags are pushed.

Local Development

# Build and test locally (single architecture)
make docker-test

# Build for current platform only
make docker-build

Screenshots

CLI Mode

When running with the -cli flag, HTTP requests are beautifully formatted and displayed directly in the terminal:

CLI Mode Screenshot

Web Interface

The web interface provides a clean and intuitive way to browse and inspect captured requests:

Web Interface Screenshot

Contributing

Contributions are welcome! Feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A tiny golang Request Bin

Resources

License

Stars

Watchers

Forks

Packages

No packages published