proxy-replay

Replay recorded HTTP/HTTPS traffic using dev-proxy-recorder. Covers starting replay mode, selecting sessions, miss handling, and switching between record and replay.

7 stars

Best use case

proxy-replay is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Replay recorded HTTP/HTTPS traffic using dev-proxy-recorder. Covers starting replay mode, selecting sessions, miss handling, and switching between record and replay.

Teams using proxy-replay should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/proxy-replay/SKILL.md --create-dirs "https://raw.githubusercontent.com/heldernoid/agentic-build-templates/main/projects/developer-tools/dev-proxy-recorder/skills/proxy-replay/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/proxy-replay/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How proxy-replay Compares

Feature / Agentproxy-replayStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Replay recorded HTTP/HTTPS traffic using dev-proxy-recorder. Covers starting replay mode, selecting sessions, miss handling, and switching between record and replay.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# proxy-replay skill

Use this skill when the user wants to:
- Run tests without hitting external APIs
- Replay previously recorded responses
- Debug why a replayed request returns a 502 (miss)
- Switch between record and replay mode

## Starting replay mode

```bash
# Replay from the most recent session
dpr start --replay

# Replay from a specific session
dpr start --replay --session stripe-checkout-flow

# Or by session ID
dpr start --replay --session 2
```

In replay mode: no upstream connections are made. All responses come from the SQLite database.

## Replay matching logic

For each incoming request, the proxy looks up a match in the active session:

1. Exact match: `method + url + SHA-256(request body)` - strongest match
2. Fuzzy fallback: `method + url` ignoring body - used when body hash does not match
3. Returns the most recently recorded match within the session

If no match is found: returns `502 {"error":"no recording found","method":"POST","url":"https://api.stripe.com/v1/refunds"}`

## Handling misses

A miss means a request was made that was never recorded in the chosen session.

To fix:
1. Switch back to record mode and make the missing request
2. Then switch back to replay

Via web UI (Settings > Proxy mode) or environment:
```bash
DPR_REPLAY=0 dpr start     # record mode
DPR_REPLAY=1 dpr start     # replay mode
```

Via API:
```
POST /api/mode
{ "replay": true, "sessionId": 1 }
```

## Switching mode at runtime

Via the web UI dashboard Settings page: toggle between RECORD and REPLAY without restarting.

Via CLI:
```bash
# Check current status
curl http://localhost:3400/api/status
# {"mode":"replay","sessionId":1,"sessionName":"stripe-checkout-flow","requestCount":48}
```

## Using replay in tests

### Jest / Vitest example

```javascript
import { beforeAll, afterAll } from 'vitest';
import { execSync } from 'child_process';

let dprProcess;

beforeAll(() => {
  // Start replay proxy in background
  dprProcess = require('child_process').spawn('node', [
    'dist/dpr.js', 'start', '--replay', '--session', 'stripe-checkout-flow',
    '--no-web'
  ], { detached: true });

  // Point app at proxy
  process.env.HTTP_PROXY = 'http://127.0.0.1:8080';
  process.env.HTTPS_PROXY = 'http://127.0.0.1:8080';
});

afterAll(() => {
  dprProcess.kill();
});
```

## Replay response fidelity

Replayed responses include:
- Original HTTP status code and status text
- All original response headers (Content-Type, etc.)
- Original response body (exact bytes)
- Response time: ~1ms (not the original upstream latency)

The `X-DPR-Replay: true` header is added to all replayed responses so your app can detect replay mode if needed.

## Selecting which session to replay

Via CLI flag: `--session <name-or-id>`

Via env var: `DPR_REPLAY_SESSION=stripe-checkout-flow`

Default: the most recently created session.

## Replay mode in CI

```yaml
# .github/workflows/test.yml
- name: Start replay proxy
  run: |
    DPR_REPLAY=1 DPR_REPLAY_SESSION=ci-fixtures \
    DPR_WEB_ENABLED=0 node dist/dpr.js start &
    sleep 1  # wait for proxy to bind

- name: Run tests
  run: pnpm test
  env:
    HTTPS_PROXY: http://127.0.0.1:8080
    NODE_EXTRA_CA_CERTS: ~/.dpr/ca.crt
```

Related Skills

ssl-proxy

7
from heldernoid/agentic-build-templates

Terminate HTTPS locally for development servers with auto-generated trusted certificates. Use when you need HTTPS on localhost, are testing Stripe webhooks that require HTTPS, building service workers (which require HTTPS), testing mixed-content policies, or any scenario where your local dev server must be accessible via https://. Triggers include "HTTPS locally", "trusted cert localhost", "https dev server", "SSL local", "mkcert", "browser security warning", "service worker local", "mixed content error".

proxy-record

7
from heldernoid/agentic-build-templates

Record HTTP/HTTPS traffic through the dev-proxy-recorder. Covers starting the proxy, session management, proxy.yaml routes, and HTTPS interception setup.

http-proxy

7
from heldernoid/agentic-build-templates

Node.js HTTP/HTTPS transparent reverse proxy implementation patterns, including header forwarding, body streaming, latency measurement, and SSE for real-time events

api-analytics-proxy

7
from heldernoid/agentic-build-templates

Transparent HTTP reverse proxy that records every request and response to SQLite and exposes a React dashboard for traffic analytics, latency percentiles, and error inspection

Skill: Uptime Monitoring

7
from heldernoid/agentic-build-templates

## Overview

Skill: Status Page

7
from heldernoid/agentic-build-templates

## Overview

Skill: unit-conversion

7
from heldernoid/agentic-build-templates

## Overview

Skill: recipe-scaler

7
from heldernoid/agentic-build-templates

## Overview

reading-list

7
from heldernoid/agentic-build-templates

Operate the reading-list API to save, manage, tag, search, and export articles.

email-digest

7
from heldernoid/agentic-build-templates

Configure, test, and troubleshoot the reading-list daily email digest delivered via nodemailer.

websocket-realtime

7
from heldernoid/agentic-build-templates

Use the WebSocket connection in poll-builder to receive live vote updates. Use when you need to stream real-time poll results, monitor a poll for new votes, or build a live dashboard. Triggers include "live results", "real-time updates", "stream votes", "watch poll", or "WebSocket".

poll-builder

7
from heldernoid/agentic-build-templates

Self-hosted poll creation tool with real-time results. Use when you need to create a poll, check vote counts, close a poll, export results, or get the shareable link for a poll. Triggers include "create poll", "vote", "poll results", "survey", "collect votes", "share poll", or any task involving polling or voting.