Routa documentation
Everything from the first command to advanced traffic mutation, fault injection, webhook testing and deterministic playback.
1 minute
Getting started
Routa needs Go 1.21+ — or download a prebuilt binary from GitHub Releases.
go install github.com/7uyash/routa/cmd/routa@latest
git clone https://github.com/7uyash/routa.git cd routa go build -o routa ./cmd/routa
Start your app on any local port, then point Routa at it and open http://localhost:4040.
routa dev 3000
Two modes
Modes of operation
Local inspector (default). routa dev 3000 runs a high-performance local proxy in front of port 3000 and serves the dashboard on 4040. No external setup at all.
Public tunnel gateway. Run a relay edge server, then connect the agent to it to receive a public URL.
routa relay --port 8080 --domain relay.example.com:8080 routa dev 3000 --relay ws://localhost:8080 --name my-app
Ship anywhere
Platforms & installation
Routa ships as native ARM64 and AMD64 binaries for macOS, Linux and Windows. Apple Silicon, Intel Macs, Raspberry Pi, ARM servers and standard x64 machines all get a platform-specific executable.
| platform | architectures | binary |
|---|---|---|
| macOS | ARM64 / AMD64 | routa-darwin-arm64 / routa-darwin-amd64 |
| Linux | ARM64 / AMD64 | routa-linux-arm64 / routa-linux-amd64 |
| Windows | ARM64 / AMD64 | routa-windows-arm64.exe / routa-windows-amd64.exe |
git clone https://github.com/7uyash/routa.git cd routa # macOS Apple Silicon (use darwin-amd64 for Intel) chmod +x bin/routa-darwin-arm64 sudo mv bin/routa-darwin-arm64 /usr/local/bin/routa # Linux AMD64 (use linux-arm64 for ARM) chmod +x bin/routa-linux-amd64 sudo mv bin/routa-linux-amd64 /usr/local/bin/routa routa dev 3000
git clone https://github.com/7uyash/routa.git cd routa .\bin\routa-windows-amd64.exe dev 3000 # Or install globally: Copy-Item .\bin\routa-windows-amd64.exe C:\Windows\System32\routa.exe
go build -o routa ./cmd/routa make build-all # Windows: .\build.ps1
Beyond tunneling
Discovery, API mapping & mock lab
Routa scans local ports and identifies running HTTP services, then proposes routing rules for your confirmation. As traffic flows, it normalizes dynamic paths such as/users/123 into/users/{id}and builds an API map with volume, latency and error-rate context.
Any captured request can become a mock in one click. Edit the response status, JSON body or artificial delay, then save and activate it locally without changing the original service.
The Connect Anything gateway creates public webhook endpoints for Stripe, GitHub, Shopify, Slack, Discord or custom providers, with signature verification options, ON/OFF controls, test deliveries and complete event history.
Reference
CLI reference
| command | description | example |
|---|---|---|
| routa dev <port> | Expose a local port and launch the dashboard | routa dev 3000 |
| routa relay | Launch the public edge relay server | routa relay --port 8080 |
| routa version | Print version and system information | routa version |
| routa help | Show CLI help text | routa help |
Flags: routa dev
| flag | env | default | description |
|---|---|---|---|
| --target, -t | ROUTA_TARGET | http://localhost:<port> | Local target URL |
| --dashboard-port | ROUTA_DASHBOARD_PORT | 4040 | Dashboard port |
| --relay | ROUTA_RELAY_URL | ws://localhost:8080 | Edge relay WebSocket URL |
| --name, -n | ROUTA_SUBDOMAIN | auto-generated | Requested subdomain |
| --secret | ROUTA_SECRET | "" | Auth secret for the relay |
| --config, -c | ROUTA_CONFIG | "" | Path to routa.yaml |
Flags: routa relay
| flag | env | default | description |
|---|---|---|---|
| --port, -p | ROUTA_RELAY_PORT | 8080 | HTTP/WS listen port |
| --domain, -d | ROUTA_RELAY_DOMAIN | localhost:8080 | Base domain for subdomains |
| --secret | ROUTA_SECRET | "" | Auth secret required from agents |
Inspector
Dashboard & inspector
- Live stream — requests arrive over WebSockets with no page refresh.
- Filters — search by keyword, or filter by method, status class (2xx / 4xx / 5xx) and type (normal vs replay).
- Split-view detail — raw request and response headers, pretty-printed JSON or form bodies, a timing breakdown, and a diff tab for shadow responses.
Reproduce
Replay & edit-replay
Re-execute any captured request without curl or Postman. Replay re-sends the exact headers, query and body. Edit & Replay opens a modal where you can change the method or path, add and remove headers, and edit the JSON payload before sending. Replayed entries carry a Replay badge and link back to their parent request ID.
Providers
Webhook testing lab
- Open the Webhook Lab tab in the dashboard.
- Create an endpoint — you get a unique URL such as
https://a7x3.routa.suyashx.dev/webhook/wh_abc123. - Point GitHub, Stripe, Shopify, Discord, Slack, Twilio, SendGrid or PayPal at it.
- Routa detects the provider, checks the signature header, logs delivery timestamps, and lets you replay or intentionally duplicate an event to test idempotency.
Fan out
Multi-service routing
Split inbound traffic across several local services from one public URL.
routes:
- path: "/api/v1/auth/*"
target: "http://localhost:8081"
- path: "/api/v1/users/*"
target: "http://localhost:8082"
- path: "/*"
target: "http://localhost:3000"Routes can also be managed live from the Routes tab in the dashboard.
Transform
Traffic mutation & mocking
- Set or remove headers, e.g. inject X-Debug or strip an internal token.
- Rewrite paths and strip prefixes: /api/v1/users → /users.
- Inject query parameters such as ?debug=1&trace=true.
- Mutate nested JSON by dot-path: set user.role=admin, remove user.ssn.
- Return mock responses without ever touching the backend.
mutations:
- name: "Inject Debug Header"
match:
path: "/api/*"
request:
set_headers:
X-Debug-Mode: "true"
remove_headers:
- "X-Internal-Token"
mock_response:
status: 200
body: '{"status": "ok", "mocked": true}'Break it
Network failure simulation
Fixed or jittered latency, forced error rates and status codes, abrupt connection drops and upstream timeouts — configured live in the Simulator panel or in YAML.
simulations:
- name: "Staging Latency & Error Test"
match:
path: "/api/v1/payments/*"
latency_ms: 250
jitter_ms: 50
error_rate: 0.1
error_status: 503Compare
Shadow traffic & response diffing
The primary service answers the real client while a duplicate request goes to the shadow target. The deep differ then compares status codes, headers and nested JSON fields, rendering side-by-side highlights in the Diff tab.
shadows:
- name: "v2 Migration Test"
match:
path: "/api/v2/*"
shadow_url: "http://localhost:9090"
compare_response: trueDeterministic
Session storage & playback
Save the current history as a fixture under ~/.routa/sessions/<name>.json, share it with your team, and replay the requests sequentially with the original inter-request timing preserved.
Schema
Config reference
version: "1"
agent:
port: 4040
target: "http://localhost:3000"
routes:
- path: "/api/v1/users/*"
target: "http://localhost:8081"
mutations: []
simulations: []
shadows: []Run any configuration with the --config flag.
routa dev --config routa.yaml
Contributing
Project structure
| package | responsibility |
|---|---|
| agent/ | Local daemon, embedded dashboard, REST API & WebSocket handlers |
| cli/ | Argument parsing, flags, terminal UI and banner rendering |
| cmd/routa/ | Application entry point |
| config/ | Config models, env binding and YAML parsing |
| diff/ | Response comparator and deep JSON body differ |
| middleware/ | Mutation, mock response and fault simulation middleware |
| protocol/ | Binary wire framing and JSON message payloads |
| proxy/ | Forwarding proxy engine with timing and header normalization |
| recorder/ | In-memory ring buffer for traffic history |
| relay/ | Edge relay server and agent connection registry |
| replay/ | Replay and edit-replay execution engine |
| router/ | Pattern-based request routing engine |
| shadow/ | Shadow forwarder and dual-target execution |
| storage/ | Session fixtures and deterministic playback runner |
| tunnel/ | Persistent WebSocket client with reconnect and ping/pong |
| webhook/ | Webhook lab, provider detector and delivery history |
go test -v ./... go vet ./...