---
title: "proxymock: Record, Mock, and Replay Real API Traffic | Speedscale"
description: "Validate AI-generated code with real production traffic before merge using proxymock record, mock, and replay workflows."
canonical: "https://speedscale.com/proxymock/"
---

[Site index](https://speedscale.com/proxymock/llms.txt) | [Markdown](https://speedscale.com/proxymock/index.md) | [Canonical page](https://speedscale.com/proxymock/)

Free CLI for API mocking and traffic replay

# Record real traffic. Mock dependencies. Replay changes.

Install proxymock and get to your first successful record, mock, or replay workflow in under 10 minutes. Validate AI-generated code with real Traffic Context before merge, without brittle hand-written stubs.

[Install proxymock](https://docs.speedscale.com/proxymock/getting-started/installation) [See 10-minute quickstart](https://speedscale.com/proxymock/#quickstart)

10-minute first success No hand-written stubs Java / .NET / Node.js / Go / Python

```bash
brew install speedscale/tap/proxymock
```

Need team workflows, CI replay, or cloud storage? [Request a demo](https://speedscale.com/company/demo/).

FIRST SUCCESS

```bash
# Install and initialize once
brew install speedscale/tap/proxymock
proxymock init

# Configure outbound proxy settings in the terminal that starts your app.
export http_proxy=http://localhost:4140
export https_proxy=http://localhost:4140
# Start your app on port 8080 with outbound proxy support.
# Record into a fixed directory.
proxymock record --app-port 8080 --out ./proxymock/recorded

# In another terminal, send a real request through the inbound proxy.
curl http://localhost:4143/
# Exercise your API routes, then stop recording with Ctrl-C.

# Start mocks using the captured outbound traffic.
proxymock mock --in ./proxymock/recorded
# Restart your app with http_proxy and https_proxy set to http://localhost:4140.
# Keep the mock running while replaying in another terminal.

# Replay recorded inbound requests and fail on response differences.
proxymock replay --in ./proxymock/recorded \
  --test-against http://localhost:8080 \
  --test-config standard \
  --fail-if 'requests.failed != 0'
```

## Choose a task

proxymock is Speedscale's CLI for recording traffic, mocking dependencies, and replaying requests locally or in CI. Run it on your machine without Kubernetes, or use Speedscale Cloud for shared storage and team workflows.

Pick a tutorial for your dependency or test runner.

*   [
    
    ### Create mocks from real API traffic
    
    Record a real request, mock the downstream API, and replay the request against a code change.
    
    Follow the tutorial](https://speedscale.com/blog/handwritten-mocks-to-proxymock/)
*   [
    
    ### Mock dependencies in GitHub Actions
    
    Use saved API responses in a Go test job with the outerspace-go demo.
    
    Follow the tutorial](https://speedscale.com/blog/automating-api-mocks-in-your-ci-pipeline-with-proxymock/)
*   [
    
    ### Mock MySQL responses
    
    Record query responses and test your application against them. Keep real-database checks for SQL and transaction behavior.
    
    Follow the tutorial](https://speedscale.com/blog/mysql-mocking-with-speedscales-proxymock-a-complete-guide/)
*   [
    
    ### Mock gRPC services
    
    Generate unary RPC mocks from a .proto, then record the real service and check for contract changes.
    
    Follow the tutorial](https://speedscale.com/blog/test-grpc-service-from-proto/)

### Try a sample app

mock-lab includes apps and saved recordings. Start with Node.js, or open the repository in GitHub Codespaces. Activate proxymock before running the examples.

[Open Node.js example](https://github.com/speedscale/mock-lab/tree/382e4a79e1eb1ae65960f6bec0be8b4b9a546f65/languages/node) [Open in GitHub Codespaces](https://codespaces.new/speedscale/mock-lab)

Local use requires activation, and CI has additional license requirements. See the [activation and CI requirements](https://docs.speedscale.com/proxymock/guides/initialize/).

## Why proxymock?

### Record Real Traffic

Capture Traffic Context, the requests and responses your app actually sees, instead of guessing at response shapes by hand.

### Mock Without Stub Drift

Turn captured traffic into local mocks so your test environment stays aligned with production behavior.

### Replay Changes Before You Ship

Run recorded traffic against local builds or CI jobs to catch regressions with the same requests users already sent.

### Fits Existing Stacks

Use the same record, mock, and replay workflow whether you run Java, .NET, Node.js, or a service in Kubernetes.

### CI-Friendly

Add replay checks to pull requests and give reviewers evidence when a change breaks real request patterns.

### Works for AI Agents Too

The same captured snapshots can be used by Claude Code, Cursor, and Copilot after your core local workflow is working.

## 10-minute quickstart

Start with a running service on port 8080. Configure its outbound proxy using the language guide below. Send requests through port 4143 while recording, then use the captured traffic for mocks and replay.

### 1\. Install

Install the CLI locally with Homebrew and keep the workflow on your machine.

### 2\. Record

Capture one working request flow so the mock data reflects reality.

### 3\. Mock

Run your app with recorded responses instead of live dependencies.

### 4\. Replay

Compare a code change against the same recorded traffic before merge.

### Core workflow

```bash
# Install and initialize once
brew install speedscale/tap/proxymock
proxymock init

# Configure outbound proxy settings in the terminal that starts your app.
export http_proxy=http://localhost:4140
export https_proxy=http://localhost:4140
# Start your app on port 8080 with outbound proxy support.
# Record into a fixed directory.
proxymock record --app-port 8080 --out ./proxymock/recorded

# In another terminal, send a real request through the inbound proxy.
curl http://localhost:4143/
# Exercise your API routes, then stop recording with Ctrl-C.

# Start mocks using the captured outbound traffic.
proxymock mock --in ./proxymock/recorded
# Restart your app with http_proxy and https_proxy set to http://localhost:4140.
# Keep the mock running while replaying in another terminal.

# Replay recorded inbound requests and fail on response differences.
proxymock replay --in ./proxymock/recorded \
  --test-against http://localhost:8080 \
  --test-config standard \
  --fail-if 'requests.failed != 0'
```

Run `proxymock init` once, choose the browser sign-in flow, and keep manual API key copy for CI or headless environments. Use your service’s actual route instead of `/` in the curl example. See the [installation](https://docs.speedscale.com/proxymock/getting-started/installation) docs and the [initialization](https://docs.speedscale.com/proxymock/guides/initialize) guide for the full flow.

### Pick your stack

Each tab opens the docs, shows the matching logo, and links into the demo-app section plus the proxymock workflow.

[View technology support](https://docs.speedscale.com/reference/technology-support/)

Pick your stack

![Java logo](https://speedscale.com/images/logos/languages/java-light.svg) ![Java logo](https://speedscale.com/images/logos/languages/java-dark.svg)

Language guide

### Java

Java demo app command with proxymock proxy environment variables.

Mode: set proxy env vars, then run your app command.

Simple mode Beginner-safe

1\. Set env vars

```bash
export JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS \
  -Dhttp.proxyHost=127.0.0.1 \
  -Dhttp.proxyPort=4140 \
  -Dhttps.proxyHost=127.0.0.1 \
  -Dhttps.proxyPort=4140"
```

2\. Run app

```bash
./mvnw spring-boot:run
```

[Open guide](https://docs.speedscale.com/reference/languages/java#proxymock)

![.NET logo](https://speedscale.com/images/logos/languages/dotnet-light.png) ![.NET logo](https://speedscale.com/images/logos/languages/dotnet-dark.png)

Language guide

### .NET

ASP.NET Core app command with proxymock proxy environment variables.

Mode: set proxy env vars, then run your app command.

Simple mode Beginner-safe

1\. Set env vars

```bash
export HTTP_PROXY=http://127.0.0.1:4140
export HTTPS_PROXY=http://127.0.0.1:4140
```

2\. Run app

```bash
dotnet run
```

[Open guide](https://docs.speedscale.com/reference/languages/dotnet#proxymock)

![Node.js logo](https://speedscale.com/images/logos/languages/nodejs-light.svg) ![Node.js logo](https://speedscale.com/images/logos/languages/nodejs-dark.svg)

Language guide

### Node.js

Node.js app command with proxymock proxy environment variables.

Mode: set proxy env vars, then run your app command.

Simple mode Beginner-safe

1\. Set env vars

```bash
export HTTP_PROXY=http://127.0.0.1:4140
export HTTPS_PROXY=http://127.0.0.1:4140
```

2\. Run app

```bash
npm start
```

[Open guide](https://docs.speedscale.com/reference/languages/nodejs#proxymock)

![Go logo](https://speedscale.com/images/logos/languages/go-light.svg) ![Go logo](https://speedscale.com/images/logos/languages/go-dark.svg)

Language guide

### Go

Go app command with proxymock proxy environment variables.

Mode: set proxy env vars, then run your app command.

Simple mode Beginner-safe

1\. Set env vars

```bash
export HTTP_PROXY=http://127.0.0.1:4140
export HTTPS_PROXY=http://127.0.0.1:4140
```

2\. Run app

```bash
go run main.go
```

[Open guide](https://docs.speedscale.com/reference/languages/golang#proxymock)

![Python logo](https://speedscale.com/images/logos/languages/python-light.svg) ![Python logo](https://speedscale.com/images/logos/languages/python-dark.svg)

Language guide

### Python

Python app command with proxymock proxy environment variables.

Mode: set proxy env vars, then run your app command.

Simple mode Beginner-safe

1\. Set env vars

```bash
export HTTP_PROXY=http://127.0.0.1:4140
export HTTPS_PROXY=http://127.0.0.1:4140
```

2\. Run app

```bash
python app.py
```

[Open guide](https://docs.speedscale.com/reference/languages/python#proxymock)

## Testing & Mocking

Turn recordings into fast, deterministic tests and use production‑like mocks to develop without external dependencies.

### Run tests

```bash
proxymock replay --test-against localhost:3000 --for 1m --vus 10
```

Regression, contract and load from real traffic, quickly fire it up from your terminal.

### Start mock server

```bash
proxymock mock -- go run main.go
```

Realistic latency and errors; add [transforms](https://docs.speedscale.com/concepts/transforms/) for chaos and data shaping.

## Close the Observability Gap for AI Agents

*   Give Claude Code, Cursor, and Copilot access to real traffic snapshots
    
*   AI agents can replay traffic, inspect responses, and validate changes
    
*   Recorded traffic stays in your local workspace
    

![proxymock MCP integration screenshot](https://speedscale.com/images/screenshots/cursor-proxymock.png)

## AI Code Validation Workflow

From capture to confidence in four steps.

1

### Capture Traffic Context

Record real API calls from staging or production

2

### AI Generates Code

Cursor, Claude, or Copilot writes your changes

3

### Replay & Compare

Validate AI code against captured traffic

4

### Ship with Confidence

Fix regressions before they reach production

![proxymock web showing recorded requests and the details of a selected request](https://speedscale.com/images/screenshots/proxymock-web.png)

## Deep Visibility

*   Browse full call details locally with proxymock web
    
*   See API, gRPC, GraphQL, DB queries, etc.
    
*   Store traffic data as part of the repo
    

## CI Pipeline

Add proxymock to your pipeline to catch issues before deploy. See full examples in our [CI/CD docs](https://docs.speedscale.com/integration/cicd/).

### Start mock server

```bash
proxymock mock \
  --verbose \
  --in $PROXYMOCK_IN_DIR/ \
  --log-to proxymock_mock.log &
```

### Replay and test

```bash
proxymock replay \
  --in "$PROXYMOCK_DIR" \
  --test-against localhost:$APP_PORT \
  --log-to $REPLAY_LOG_FILE \
  --fail-if "latency.max > 1500" \
  -- $APP_COMMAND
```
