返回资讯中心
外部精选
软件工程
#开发者实时流

Zlodev – Local HTTPS reverse proxy with auto-certificates, custom DNS, and a TUI

Local reverse proxy with TLS termination, custom DNS, and a terminal UI.

Hacker News 最新ivanvandot2026/10/18 · 2026/10/1828 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

Local reverse proxy with TLS termination, custom DNS, and a terminal UI.

zlodev sits between your browser and your local dev server, providing HTTPS with a real certificate, a custom domain (https://dev.lo), and a TUI for inspecting, intercepting, and replaying HTTP traffic.

HTTPS reverse proxy — TLS termination with auto-generated CA and domain certificates

Multi-app routing — route by subdomain (api.dev.lo) or path prefix (/api) to local ports or external hosts

Custom DNS — resolves *.lo to localhost, no /etc/hosts editing

Terminal UI — live request list with method, path, status, timing, and body size

Dev server launcher — run your dev server alongside zlodev and monitor its output in a split-pane TUI

Request/response interception — hold, inspect, edit, accept, or drop requests and responses with optional pattern matching

Request replay — re-send any completed request

Copy as curl — copy any request as a curl command

HAR export — export captured traffic as HTTP Archive files

Request starring — star important requests so they survive ring buffer overflow

Search/filter — filter requests by path, method, or status code

WebSocket passthrough — transparent proxying of WebSocket upgrades

Cross-platform — macOS, Linux, and Windows

Install

Pre-built binary

Pre-built binaries have no external dependencies — single binary, nothing to install.

curl -fsSL https://raw.githubusercontent.com/vandot/zlodev/main/install.sh | sh

Build from source

Building from source requires Zig 0.15.2. No other dependencies — BoringSSL is compiled from source automatically.

git clone https://github.com/vandot/zlodev.git cd zlodev zig build -Doptimize=ReleaseSafe

The binary is at zig-out/bin/zlodev.

On Linux, grant the binary permission to bind to privileged ports (80, 443) without root:

sudo setcap cap_net_bind_service=+eip zig-out/bin/zlodev

Build options

Option Description Default

-Dversion=STRING Version string dev

-Dmax-entries=N Max request entries in ring buffer 500

-Dstrip=BOOL Strip debug info from the binary true unless Debug build

Quick start

macOS / Linux

Option 1: zlodev launches your dev server

1. Install certificates and DNS resolver (one-time setup, requires sudo)

zlodev install

2. Start zlodev with your dev server integrated

zlodev start --command="npm run dev"

Your app is now available at https://dev.lo. The TUI shows live traffic and your dev server logs side-by-side.

Option 2: Launch dev server separately (original workflow)

1. Install certificates and DNS resolver (one-time setup, requires sudo)

zlodev install

2. Start your dev server (e.g. on port 3000)

npm run dev &

3. Start zlodev

zlodev start

Your app is now available at https://dev.lo. The TUI shows live traffic.

Run all commands in an elevated terminal (Run as Administrator).

1. Install certificates and DNS resolver

zlodev install

2. Start your dev server, then start zlodev

zlodev start

Note: Disable "Use secure DNS" in your browser (Edge: Settings → Privacy → Security → toggle off "Use secure DNS") for DNS resolution to work.

Commands

zlodev install install certificates and DNS zlodev install --cert install certificates only zlodev install --dns install DNS only zlodev uninstall uninstall certificates and DNS zlodev uninstall --cert uninstall certificates only zlodev uninstall --dns uninstall DNS only zlodev start start proxy + DNS + TUI zlodev start --dns start DNS server only (log mode)

Options

-p=PORT, --port=PORT target port [auto-detect or 3000] -b=ADDR, --bind=ADDR listen address [default 0.0.0.0] --route=PATTERN=TARGET route by subdomain or path (repeatable) --command=CMD dev server command to launch and monitor -c=PATH, --config=PATH config file path [default .zlodev] --max-body=SIZE max request body size [default 10M] --no-tui disable TUI, log to stderr -l, --local use .local domain (mDNS) --dns DNS only (install/uninstall/start) --cert certificates only (install/uninstall) -f, --force force reinstall -v, --version show version -h, --help show help

SIZE accepts suffixes: K (KB), M (MB), G (GB). Example: --max-body=50M

Place a .zlodev file in your project directory instead of repeating CLI flags:

port=3000 bind=127.0.0.1 route=api=3001 route=/webhooks=8080 command=npm run dev intercept=POST /api no-tui

zlodev reads .zlodev from the current directory on start. Use -c=PATH to specify a different location. CLI arguments override config file values.

Supported options: port, p, bind, b, route, max-body, command, intercept, no-tui, local, l, dns.

Route requests to different backend ports by subdomain or path prefix:

Subdomain routing — no "/" prefix

zlodev start --route=api=3001 --route=dashboard=4200

api.dev.lo → 127.0.0.1:3001

dashboard.dev.lo → 127.0.0.1:4200

dev.lo → 127.0.0.1:3000 (default)

Path routing — "/" prefix

zlodev start --route=/api=3001 --route=/admin=8080

dev.lo/api/* → 127.0.0.1:3001

dev.lo/admin/* → 127.0.0.1:8080

dev.lo/* → 127.0.0.1:3000 (default)

Mix both

zlodev start --route=api=3001 --route=/webhooks=8080

External upstream — route to remote services

zlodev start --route=api=staging.api.example.com zlodev start --route=/payments=payments.stripe.com:443

api.dev.lo → staging.api.example.com:443 (TLS)

dev.lo/payments/* → payments.stripe.com:443 (TLS)

Priority: subdomain match > longest path prefix > default port.

External routes connect via TLS, rewrite the Host header to the upstream hostname, and rewrite Set-Cookie domain attributes to dev.lo so cookies work correctly in the browser. If no port is specified, defaults to 443.

Note: Subdomain routes are not supported in local mode (-l), since mDNS does not support arbitrary subdomains.

Launch your dev server alongside zlodev and monitor its output in the TUI:

CLI

zlodev start --command="npm run dev"

Or in .zlodev config

command=npm run dev

The dev server starts when zlodev boots and appears in a split-pane below the request list. You can toggle the logs pane with l, switch focus between requests and logs with Tab, and restart the server with R (when focused on logs).

If --port is not specified, zlodev detects the port from:

Use .local domain for access from mobile devices on the same network

zlodev install -l zlodev start -l

-> https://yourhostname.local

Headless mode

Run without TUI, logs to stderr (useful for scripts/CI)

zlodev start --no-tui

Intercept

Press i in the TUI to enable intercept mode. You'll be prompted for a pattern — matching requests are held for inspection while all others pass through normally.

Without a req: or resp: prefix, both requests and responses are intercepted.

When a response is intercepted, the TUI shows two entries: the original request with its upstream round-trip time, and a ↳ response entry showing RESP in the status column with a live hold timer. Press e on the response entry to edit status code, headers, and body before it reaches the browser. Press a to accept or d to drop.

Response entries cannot be replayed (r/R) — replay the original request above it instead, which will naturally produce a new response.

Pattern matching is case-insensitive. Press i again to disable intercept and release all held requests.

You can also set a default intercept pattern in your .zlodev config file:

intercept=resp:POST /api

TUI keybindings

List view (requests pane)

Key Action

j / k (or ↓ / ↑) Move down / up

G Go to end

g Go to top

s Toggle autoscroll

l Toggle logs pane (if dev server configured)

Tab Switch focus between requests and logs

Enter Open detail view

/ Search / filter by path, method, or status

Esc Clear filter

Star / unstar request (survives buffer overflow)

i Intercept (prompts for pattern / toggles off)

a Accept held request

A Accept all held requests

d Drop held request / delete completed request

c Copy request as curl command

e Edit request / response

r Edit & replay request

R Quick replay (no edit) or restart dev server (when focused on logs)

E Export traffic as HAR file

C Clear all requests

? Toggle help overlay (Esc also closes it)

q Quit

Logs pane (when dev server is running)

Key Action

j / k (or ↓ / ↑) Scroll down / up

G Go to end

g Go to top

s Toggle autoscroll

R Restart dev server

Tab Switch focus to requests

Detail view

Key Action

j / k (or ↓ / ↑) Scroll down / up

G / g Scroll to bottom / top

n / p (or → / ←) Next / previous request

b Toggle body display

a Accept held request

d Drop held request / delete completed request

Star / unstar request

c Copy request as curl command

e Edit request / response

r Edit & replay request

R Quick replay (no edit)

i Intercept (prompts for pattern / toggles off)

s Toggle autoscroll

q / Esc Back to list

Edit view

Key Action

Tab / Shift+Tab Next / previous field

← / →, Home / End Move cursor

↑ / ↓ Move between lines (multiline fields)

Enter New line (multiline fields) or next field

Ctrl+S Save — accept held entry with edits, or replay edited request

Esc Cancel

How it works

DNS — A lightweight DNS server resolves *.lo queries to 127.0.0.1. On macOS it registers via /etc/resolver/, on Linux via systemd-resolved, on Windows via NRPT rules.

Certificates — On install, zlodev generates a local CA and domain certificate, then adds the CA to your system trust store. The CA is unique to your machine.

Proxy — An HTTPS reverse proxy accepts connections on port 443, terminates TLS, and forwards plain HTTP to your dev server. Responses are relayed back over TLS.

HTTP server — A plain HTTP server on port 80 serves the CA certificate download page (for mobile devices) and redirects other requests to HTTPS.

Dev server integration — When --command is provided, zlodev spawns a shell process running your dev server command. stdout and stderr are captured into a bounded ring buffer and displayed in a split-pane logs view. The dev server restarts when you press R in the logs pane, or shuts down cleanly when you quit zlodev.

Port 443 already in use

Another process is using port 443. Check with:

macOS

sudo lsof -i :443

Linux

sudo ss -tlnp | grep :443

Windows (elevated terminal)

netstat -an | findstr ":443"

Permission denied on ports 80/443 (Linux)

On Linux, binding to ports below 1024 requires elevated privileges. Instead of running as root, zlodev uses Linux file capabilities. The install script sets this automatically, but if you built from source:

sudo setcap cap_net_bind_service=+eip $(which zlodev)

This grants only the specific capability to bind privileged ports — no other root access.

zlodev install -f

DNS not resolving

Check if the DNS resolver is installed:

macOS

cat /etc/resolver/lo

Linux

resolvectl query dev.lo

Windows (elevated PowerShell)

Resolve-DnsName dev.lo

If missing, reinstall DNS:

zlodev install --dns

On Windows, make sure "Use secure DNS" is disabled in your browser — Chromium browsers bypass the system DNS resolver when this is enabled.

Make sure the phone is on the same network

Start zlodev with --local flag: zlodev start -l

Open http://yourhostname.local/ca on the phone to install the CA certificate

Follow the platform-specific instructions on the download page

Uninstall

zlodev uninstall

This removes the CA from your system trust store, deletes generated certificates, and removes the DNS resolver configuration.

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →