har-capture-proxy — Fast HAR Capture & Response Mutation Proxy

High-performance MitM proxy with HAR capture and response mutation. Drop-in replacement for BrowserMob Proxy, written in Rust.

Download Binary View on GitHub API Docs

Features

Everything you need to intercept, capture, and transform HTTP traffic.

Compatible

BrowserMob-Proxy REST API

Full compatibility with all 25+ BMP endpoints. Swap the binary and keep your existing test suite unchanged.

Compatible

HAR Capture

Record HTTP Archive (HAR 1.2) files with full request/response details, timing, headers, and content. Page refs supported.

New

JSON Mutations (JSONPath)

Mutate JSON response bodies using JSONPath selectors. Set, replace, or delete values deep within API responses on the fly.

New

HTML Transforms (CSS Selectors)

Rewrite HTML responses with CSS selectors powered by lol_html. Set text, attributes, or inject content at streaming speed.

New

Text Replacements

Simple find-and-replace across response bodies. Supports plain text matching for quick content overrides.

New

Sandboxed JS Transforms

Write JavaScript transform functions that run in a secure, sandboxed V8 isolate. Full programmatic control over response mutation.

New

Fake Data Generation

Generate realistic fake names, emails, addresses, phone numbers, and more using built-in data generators. Perfect for test fixtures.

Compatible

URL Filtering

Whitelist or blacklist URLs with regex patterns and HTTP status codes. Control exactly which traffic flows through.

Compatible

Bandwidth & Latency Controls

Throttle downstream/upstream bandwidth and add latency to simulate slow networks. Configurable per proxy session.


BrowserMob Proxy Compatibility

Every BMP endpoint is supported, plus powerful new mutation capabilities.

Endpoint Method BrowserMob Proxy har-capture-proxy
Proxy Lifecycle
/proxy POST
/proxy GET
/proxy/{port} DELETE
HAR Capture
/proxy/{port}/har PUT
/proxy/{port}/har GET
/proxy/{port}/har/pageRef PUT
Headers & Auth
/proxy/{port}/headers POST
/proxy/{port}/auth/basic/{domain} POST
URL Filtering
/proxy/{port}/whitelist PUT
/proxy/{port}/whitelist DELETE
/proxy/{port}/blacklist PUT
Network Configuration
/proxy/{port}/limit PUT
/proxy/{port}/timeout PUT
/proxy/{port}/hosts POST
/proxy/{port}/retry PUT
/proxy/{port}/rewrite PUT
/proxy/{port}/dns/cache DELETE
/proxy/{port}/wait PUT
Request & Response Filters
/proxy/{port}/filter/request POST
/proxy/{port}/filter/response POST
Response Mutation Rules
/proxy/{port}/rules POST New
/proxy/{port}/rules GET New
/proxy/{port}/rules DELETE New

Performance

Built in Rust for speed, safety, and minimal resource usage.

~5 MB
Binary Size
vs ~50 MB JVM + BMP JAR
<10 ms
Startup Time
vs 2-5s JVM cold start
~3 MB
Memory (idle)
vs ~200 MB JVM baseline
Streaming
HTML Processing
lol_html — zero-allocation streaming rewriter
Async
Concurrency Model
Tokio — thousands of concurrent connections
rustls
TLS Implementation
Memory-safe, no OpenSSL dependency

Quick Start

Up and running in under a minute.

1

Download the binary

Grab the latest release for your platform from GitHub.

# macOS (Apple Silicon)
curl -L https://github.com/jaygen/har-capture-proxy/releases/latest/download/har-capture-proxy-aarch64-apple-darwin \
  -o har-capture-proxy && chmod +x har-capture-proxy

# Linux (x86_64)
curl -L https://github.com/jaygen/har-capture-proxy/releases/latest/download/har-capture-proxy-x86_64-unknown-linux-gnu \
  -o har-capture-proxy && chmod +x har-capture-proxy
2

Start the proxy server

Launch the REST API on the control port.

./har-capture-proxy --port 8080
3

Create a proxy session

POST to /proxy to spin up a new proxy listener.

curl -X POST http://localhost:8080/proxy
# {"port": 8081}
4

Configure your browser or test framework

Point your HTTP proxy to localhost:8081 and install the CA cert from ~/.har-capture-proxy/.

# The CA certificate is auto-generated at:
# ~/.har-capture-proxy/har-capture-proxy-ca.pem
# Common Name: "har-capture-proxy CA"
5

Capture traffic as HAR

Start recording, browse, then retrieve the HAR file.

# Start HAR capture
curl -X PUT http://localhost:8080/proxy/8081/har

# ... drive your browser / run tests ...

# Retrieve HAR
curl http://localhost:8080/proxy/8081/har -o capture.har

Migrating from BrowserMob Proxy

Three steps to switch. No code changes required for standard usage.

Step 1

Replace the binary

Swap your BMP JAR + JVM with the single har-capture-proxy binary. Same --port flag, same REST API.

Step 2

Trust the CA certificate

Install the auto-generated CA cert from ~/.har-capture-proxy/har-capture-proxy-ca.pem into your browser or test framework trust store.

Step 3

Run your test suite

All BMP REST endpoints are compatible. Your existing Selenium, Playwright, or HTTP client code works without changes.