Skip to content

Repository files navigation

RouteMan

RouteMan

The Local Route Manager for Frontend Developers
Bringing Nginx's routing power to your desktop — solve CORS, multi-backend routing, and API mocking locally.

100% Local Lightweight Secure Open Source

中文文档 · Detailed Guide · Features · Getting Started · Usage


RouteMan is a lightweight desktop network proxy tool that brings Nginx-level routing capabilities to the client side. Built with Tauri 2 (Rust + React), it intercepts, inspects, and modifies HTTP/HTTPS/WebSocket requests during local development — solving cross-origin debugging, multi-backend request distribution, and API mocking without complex configuration.

100% Local & Secure — All traffic processing happens on your machine. No cloud services, no telemetry, no data ever leaves your device. Your request data stays yours.

Why RouteMan?

Unlike heavyweight tools like Charles or Fiddler, RouteMan is purpose-built for modern frontend development workflows:

RouteMan Charles / Fiddler
Install size ~10 MB (Tauri native) 50–200 MB (Electron / .NET)
Startup time Instant Seconds
Configuration Visual drag-and-drop + YAML Complex GUI forms
Project isolation Built-in multi-project Manual workspace switching
Privacy 100% local, no cloud Some require accounts / cloud
Price Free & Open Source (MIT) Commercial license

Features

  • 100% Local & Private — All proxy processing runs locally on your machine. No cloud services, no telemetry, no account required. Your traffic data never leaves your device.
  • HTTP/HTTPS/WebSocket Proxy — Local proxy server with HTTPS MITM decryption via self-signed CA certificate, native WebSocket tunnel support
  • System-Level Proxy — Captures traffic from all clients (browser, Postman, WeChat DevTools, curl, Node.js scripts), not just the browser. One config, every client.
  • Multi-Backend Routing — Route /api/user to developer A, /api/order to developer B. Path-level traffic distribution for microservices and team collaboration
  • Multi-Project Isolation — Organize rules by project; each project listens to specific hosts/domains, keeping configurations independent
  • Dual Configuration Modes — YAML editor (Monaco Editor) + Visual drag-and-drop rule builder
  • Rich Match Conditions — Match by domain (wildcard), path (wildcard), HTTP method, headers, query params, and cookies
  • 5 Rule Actions — Forward, Redirect (301/302/307), Mock (inline JSON or file), Block (403), and Pass-through
  • WebSocket Rule Support — Forward, Block, and Direct fully work with WebSocket; handshake-phase header modification and proxy markers supported
  • Request/Response Header Rewrite — Add, override, or remove headers on matched rules (works for both HTTP and WebSocket handshake)
  • Batch Operations — Multi-select rules for batch enable, disable, or delete
  • Real-time Proxy Logs — Live request log panel with method, status, duration, action and protocol (HTTP/WebSocket) filtering, and click-to-view detail card (request/response headers, request/response body, matched rule info)
  • Request/Response Body Capture — View request and response body content in log details with JSON auto-formatting and one-click copy. Hot-switchable without restarting the proxy.
  • System Proxy Automation — Automatically sets/restores system proxy when starting/stopping RouteMan, with PAC conflict detection and auto-takeover
  • CORS Bypass — One-click toggle to auto-inject CORS headers into all responses and handle OPTIONS preflight requests, eliminating cross-origin issues during local development
  • System Tray — Minimize to tray on close; right-click tray icon to quickly toggle proxy, create projects, or access the setup guide without opening the main window
  • Auto Update Check — Silent background version check on startup with notification
  • i18n — Full internationalization support (English / 简体中文)
  • Dark Theme — Modern dark UI designed for long development sessions

Screenshots

Main Interface with Proxy Logs

Visual Rule Editor

YAML Editor

Tech Stack

Layer Technology
Framework Tauri 2
Backend Rust — hyper, tokio, rcgen, rustls
Frontend React 19 + TypeScript + Vite
Editor Monaco Editor (YAML mode)
i18n react-i18next + browser language detection
Drag & Drop dnd-kit
CI/CD GitHub Actions (multi-platform auto-build & release)

Getting Started

Prerequisites

  • Node.js >= 20
  • Rust (stable)
  • Platform-specific dependencies (Linux only):
    sudo apt install libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

Development

# Clone the repository
git clone https://github.com/bluvenr/routeman.git
cd routeman

# Install dependencies
npm install

# Start development server
npm run tauri:dev

Build

npm run tauri:build

Build output will be in src-tauri/target/release/bundle/.

Usage

Quick Start

  1. Install HTTPS Certificate — Click the HTTPS button in the top bar, install the CA root certificate to your system trust store (required for HTTPS interception)
  2. Create a Project — Click the + button in the sidebar, enter a project name and listen targets (e.g. api.example.com, *.shop.com, 192.168.1.10:3001)
  3. Add Rules — Use the Visual editor to add rules, or switch to YAML mode for direct editing
  4. Start Proxy — Click the toggle button, then configure your browser or app HTTP proxy to 127.0.0.1:<port>

Rule Configuration (YAML)

Each project contains a list of rules. A rule consists of match conditions and an action:

name: E-commerce Debug
enabled: true
hosts:
  - api.shop.com
  - "*.shop.com"
rules:
  # Forward: redirect API calls to local dev server
  - name: Local Dev Server
    match:
      hosts:
        - api.shop.com
      paths:
        - /api/user/*
      methods:
        - GET
    action:
      type: forward
      target: "http://192.168.1.10:3001"

  # Mock: return inline JSON response
  - name: Feature Flag Mock
    match:
      hosts:
        - api.shop.com
      paths:
        - /api/config
    action:
      type: mock
      response: '{"debug": true, "feature_flag": "on"}'
      status_code: 200

  # Header matching: match specific request headers
  - name: Auth Header Check
    match:
      headers:
        - key: x-api-version
          value: "v2"
      query:
        - key: env
          value: staging
    action:
      type: forward
      target: "http://staging-api.internal:8080"

  # Block: reject specific requests
  - name: Block Tracking
    match:
      paths:
        - /api/tracking/**
    action:
      type: block

Match Conditions Reference

Condition Field Example Description
Domain hosts api.example.com, *.shop.com Exact or wildcard domain match
Path paths /api/user/*, /api/** URL path with wildcard support
Method methods GET, POST HTTP method filter
Headers headers {key: "x-token", value: "*"} HTTP header key-value match
Query query {key: "env", value: "staging"} Query string parameter match
Cookies cookies {key: "session", value: "*"} Cookie key-value match

Matching logic: Empty condition = match all for that dimension. Within a field: OR (any match). Across fields: AND (all must match).

Supported Host Patterns

Pattern Description Example
Domain Exact match api.example.com
Wildcard Subdomain wildcard *.example.com
IP:Port Specific server 192.168.1.10:3001
Empty Listen to all requests (leave blank)

Rule Actions

Action Description Use Case
Forward Proxy to a different backend (scheme+host+port only; path & query auto-preserved) Route API calls to local dev server
Redirect HTTP redirect (301/302/307) with template variable support Redirect to a different URL, preserving path/query
Mock Return mock response (inline or file) API mocking during frontend dev
Block Reject with 403 Block tracking or ad requests
Direct Pass through to original destination Allow specific paths unchanged

Redirect Template Variables

Redirect URLs support template variables that are replaced with values from the original request:

Variable Replaced With
${protocol} Original protocol (http or https)
${host} Original hostname
${port} Original port (empty if default)
${path} Original request path
${query} Original query string (without ?)

Example: https://staging.example.com${path}?${query} will redirect to the same path and query on staging.example.com.

Project Structure

RouteMan/
├── src/                    # React frontend
│   ├── components/         # UI components (RuleCard, Modals, Editors)
│   ├── i18n/               # Internationalization (en, zh-CN)
│   └── App.tsx             # Main application
├── src-tauri/              # Rust backend
│   ├── src/
│   │   ├── proxy/          # Proxy server (hyper-based)
│   │   ├── config.rs       # Data model definitions (Rule, Match, Action)
│   │   ├── cert.rs         # CA certificate management
│   │   ├── matcher.rs      # Rule matching engine
│   │   ├── project.rs      # Multi-project manager
│   │   ├── settings.rs     # App settings persistence
│   │   ├── system_proxy.rs # System proxy automation
│   │   └── update.rs       # Version update checker
│   └── tauri.conf.json
├── .github/workflows/      # CI/CD (auto-build & release)
└── package.json            # Version source of truth

Contributing

Issues and Pull Requests are welcome!

License

MIT

About

A lightweight local route manager for frontend developers — bringing Nginx-level routing to your desktop. Intercept, mock, and rewrite HTTP/HTTPS/WebSocket traffic from any client with visual rules.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages