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.

install
go install github.com/7uyash/routa/cmd/routa@latest
build from source
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.

terminal 1 / terminal 2
routa relay --port 8080 --domain relay.example.com:8080
routa dev 3000 --relay ws://localhost:8080 --name my-app

Reference

CLI reference

commanddescriptionexample
routa dev <port>Expose a local port and launch the dashboardrouta dev 3000
routa relayLaunch the public edge relay serverrouta relay --port 8080
routa versionPrint version and system informationrouta version
routa helpShow CLI help textrouta help

Flags: routa dev

flagenvdefaultdescription
--target, -tROUTA_TARGEThttp://localhost:<port>Local target URL
--dashboard-portROUTA_DASHBOARD_PORT4040Dashboard port
--relayROUTA_RELAY_URLws://localhost:8080Edge relay WebSocket URL
--name, -nROUTA_SUBDOMAINauto-generatedRequested subdomain
--secretROUTA_SECRET""Auth secret for the relay
--config, -cROUTA_CONFIG""Path to routa.yaml

Flags: routa relay

flagenvdefaultdescription
--port, -pROUTA_RELAY_PORT8080HTTP/WS listen port
--domain, -dROUTA_RELAY_DOMAINlocalhost:8080Base domain for subdomains
--secretROUTA_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

  1. Open the Webhook Lab tab in the dashboard.
  2. Create an endpoint — you get a unique URL such as https://a7x3.routa.suyashx.dev/webhook/wh_abc123.
  3. Point GitHub, Stripe, Shopify, Discord, Slack, Twilio, SendGrid or PayPal at it.
  4. 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.

routa.yaml
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.
routa.yaml
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.

routa.yaml
simulations:
  - name: "Staging Latency & Error Test"
    match:
      path: "/api/v1/payments/*"
    latency_ms: 250
    jitter_ms: 50
    error_rate: 0.1
    error_status: 503

Compare

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.

routa.yaml
shadows:
  - name: "v2 Migration Test"
    match:
      path: "/api/v2/*"
    shadow_url: "http://localhost:9090"
    compare_response: true

Deterministic

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

routa.yaml
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

packageresponsibility
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
testing
go test -v ./...
go vet ./...