| Crates.io | jsonrpc-debugger |
| lib.rs | jsonrpc-debugger |
| version | 0.1.7 |
| created_at | 2025-06-03 18:21:58.230258+00 |
| updated_at | 2025-06-20 00:01:56.073265+00 |
| description | A terminal-based JSON-RPC debugger with interception capabilities |
| homepage | https://github.com/shanejonas/jsonrpc-debugger |
| repository | https://github.com/shanejonas/jsonrpc-debugger |
| max_upload_size | |
| id | 1699359 |
| size | 186,323 |
A terminal-based JSON-RPC debugger with interception capabilities, built with Rust and ratatui. Inspect, modify, and debug JSON-RPC requests and responses in real-time.
Demo video of pointing metamask JSON-RPC at the debugger:
https://github.com/user-attachments/assets/20a23f55-e3b8-44b1-9536-fcc1fd6e09dc
cargo install jsonrpc-debugger
cargo install --git https://github.com/shanejonas/jsonrpc-debugger
git clone https://github.com/shanejonas/jsonrpc-debugger.git
cd jsonrpc-debugger
cargo build --release
cargo install --path .
Start the debugger with default settings (port 8080, no default target):
jsonrpc-debugger
# or during development:
cargo run
# Custom port
jsonrpc-debugger --port 9090
# Custom target URL
jsonrpc-debugger --target https://your-api.com
# Both custom port and target
jsonrpc-debugger --port 9090 --target https://your-api.com
# Show help
jsonrpc-debugger --help
Once the debugger is running, send JSON-RPC requests to the proxy:
curl -X POST http://localhost:8080 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"your_method","params":[],"id":1}'
The TUI is divided into three main sections:
ββ Status ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β JSON-RPC Debugger | Status: RUNNING | Port: 8080 | Target: https://api.example.com β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββ JSON-RPC βββββββββββββββββββββββββββββ ββ Details βββββββββββββββββββββββββββββββββββ
β Status βTransportβMethod βIDβDurβ β Transport: Http β
β β Success β HTTP β eth_call β1 β45mβ β Method: eth_call β
β β Error β HTTP β eth_send β2 β12mβ β ID: 1 β
ββ³ Pending β HTTP β eth_blockβ3 β11mβ β β
β β β REQUEST: β
β β β HTTP Headers: β
β β β content-type: application/json β
β β β β
β β β JSON-RPC Request: β
β β β { β
β β β "jsonrpc": "2.0", β
β β β "method": "eth_call", β
β β β "params": [...], β
β β β "id": 1 β
β β β } β
βββββββββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββββββββββββ
ββ Controls ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β q quit | ββ/^n/^p navigate | j/k/d/u/G/g scroll | s start/stop | t target | p pause β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β/β or Ctrl+p/Ctrl+n - Navigate between requestsj/k - Scroll details panel up/down (vim-style)d/u or Ctrl+d/Ctrl+u - Page down/up in detailsG - Go to bottom of detailsg - Go to top of detailss - Start/stop the proxy servert - Edit target URLc - Create new request (normal mode) / Complete request with custom response (intercept mode)q - Quit applicationp - Toggle pause mode (intercept new requests)a - Allow selected intercepted requeste - Edit selected request body in external editorh - Edit selected request headers in external editorc - Complete request with custom responseb - Block selected requestr - Resume all pending requestsThe debugger supports Charles Proxy-style request interception:
p to start intercepting requestse to edit request body in your external editorh to edit HTTP headersc to create a custom responsea to allow, b to block, or r to resume allThe debugger uses your system's default editor for request modification:
$EDITOR environment variable$VISUALvim, then nano, then viModified requests show with a β icon and [MODIFIED] or [BODY]/[HEADERS] labels.
EDITOR - Preferred text editor for request modificationVISUAL - Alternative editor (fallback)Some ports may conflict with system services:
Use alternative ports like 8080, 9090, 3000, 4000, 8000, or 8888.
# Start debugger
jsonrpc-debugger --port 8080
# Set target URL in the TUI (press 't')
# Then make requests in another terminal
curl -X POST http://localhost:8080 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
jsonrpc-debuggert and enter your targetpe to modify body or h for headersac to create a custom responsec in normal modeIf you get a "port already in use" error:
# Check what's using the port
netstat -an | grep :8080
# Use a different port
jsonrpc-debugger --port 9090
If requests fail with "connection refused":
t in the TUI)If external editing fails:
# Set your preferred editor
export EDITOR=code # VS Code
export EDITOR=nano # Nano
export EDITOR=vim # Vim
The debugger displays JSON with:
If JSON appears malformed, check that the original request/response is valid JSON.
cargo test
# Debug build
cargo build
# Release build
cargo build --release
src/
βββ main.rs # CLI and main application loop
βββ app.rs # Application state and logic
βββ ui.rs # TUI rendering and layout
βββ proxy.rs # HTTP proxy server implementation
βββ lib.rs # Library exports for testing
MIT License - see LICENSE file for details.