Show HN: Oproxy – 在浏览器中检查并修改网络流量
Show HN: Oproxy – inspect and modify network traffic from the browser

原始链接: https://github.com/sauravrao637/oproxy

**oproxy** 是一款功能通用的本地代理工具,专为开发者设计,用于检查、修改和重放 HTTP、HTTPS 和 SOCKS5 流量。无论是测试浏览器、移动应用还是命令行工具,oproxy 都能提供对请求、响应及元数据的深度可见性,并支持 JWT、GraphQL 和 WebSocket。 主要功能包括: * **流量操作:** 通过规则集、远程/本地映射、限流、断点、模拟响应和 Lua 脚本来修改流量。 * **工作流集成:** 重放捕获的请求、手动构建请求,并将数据导出为 HAR、cURL、Fetch 或 Python 代码片段。 * **AI 辅助:** 使用集成的兼容 OpenAI 的聊天模型来检查状态并自动化配置代理。 * **简易部署:** 可通过 Docker 或从源码(Rust/Node.js)运行。在信任本地 CA 证书后,即可支持 MITM 中间人拦截。 oproxy 是无需更改应用代码即可调试服务的理想选择。它允许用户模拟网络状况、拦截请求或将流量重定向到测试环境,从而简化测试流程。通过持久化会话并提供完善的管理界面,它成为了快速 API 开发和稳健测试工作流中不可或缺的工具。

抱歉。
相关文章

原文

oproxy is a local HTTP, HTTPS, and SOCKS5 proxy for inspecting, replaying, and modifying traffic.

It is for developers testing browsers, CLIs, mobile apps, API clients, services, and test suites on their own machine or in a local Docker container.

  • Capture HTTP traffic and HTTPS traffic after trusting the local oproxy CA.
  • View requests, responses, headers, bodies, status, timing, tags, notes, and selected inspector data.
  • Replay captured requests and open them in Compose.
  • Build manual requests with headers, query params, auth, raw bodies, variables, collections, and cURL export.
  • Export captures as HAR or generated cURL, Fetch, and Python snippets.
  • Modify traffic with rule sets, map-remote, map-local, access rules, throttling, breakpoints, mock responses, DNS overrides, capture filters, Lua scripts, and upstream proxy chaining.
  • Use the authenticated Assistant to inspect state and prepare confirmed proxy changes through an OpenAI-compatible chat model.
  • Run from source or Docker with persistent volumes for CA material and local state.

Short demo video

docker run --rm \
  --name oproxy \
  -p 127.0.0.1:8080:8080 \
  -p 127.0.0.1:1080:1080 \
  -e OPROXY_BIND_HOST=0.0.0.0 \
  -e OPROXY_MITM_ENABLED=true \
  -v oproxy-certs:/app/certs \
  -v oproxy-storage:/app/storage \
  ghcr.io/sauravrao637/oproxy:latest

Open http://127.0.0.1:8080.

Or build locally:

docker build -t oproxy:latest .
docker compose up --build

The included Compose file uses host networking, persists /app/certs and /app/storage, and sets OPROXY_BIND_HOST=0.0.0.0.

Requirements:

  • Rust 1.85 or newer
  • Node.js 22 or newer
  • Yarn via Corepack
corepack enable
yarn --cwd src/design install --frozen-lockfile
yarn --cwd src/design build
cargo run --release

Open http://127.0.0.1:8080.

curl -x http://127.0.0.1:8080 http://example.com

The request appears in the Sessions view.

curl http://127.0.0.1:8080/admin/ca -o oproxy-ca.crt
curl --cacert oproxy-ca.crt -x http://127.0.0.1:8080 https://example.com

For browser HTTPS capture, install the CA from http://127.0.0.1:8080/admin/ca into the browser or OS trust store.

  • Act as a forward HTTP proxy on OPROXY_PORT/port, default 8080.
  • Serve the local management UI and API from the same listener.
  • Intercept HTTPS CONNECT traffic when MITM is enabled and the client trusts the generated CA.
  • Optionally listen for SOCKS5 CONNECT traffic on socks5_port.
  • Optionally run a second TLS listener with https_port.
  • Capture live sessions in memory with bounded session and body retention.
  • Save and load sessions explicitly with admin endpoints.
  • Export HAR, cURL, Fetch, and Python snippets, redacted by default.
  • Import HAR files and oproxy JSON session data.
  • Stream session-change notifications with server-sent events.
  • Inspect JWT, GraphQL, gRPC, and WebSocket frame metadata when matching traffic is captured.
  • Debug a browser or CLI request without changing application code.
  • Replay a captured request after editing headers or body in Compose.
  • Test a frontend against mock responses or local fixture files.
  • Route a subset of traffic to a staging service.
  • Reproduce slow or bandwidth-limited responses.
  • Pause matching requests or responses before they continue.
  • Validate how a client behaves when requests are blocked, redirected, or rewritten.

oproxy sessions screenshot

oproxy compose screenshot

MIT

联系我们 contact @ memedata.com