---
title: "Architecture | Speedscale Docs"
description: "Explore the architecture of proxymock to understand how it captures and replays traffic for API testing without modifying your application setup"
canonical: "https://docs.speedscale.com/proxymock/how-it-works/architecture/"
---

[Documentation index](https://docs.speedscale.com/proxymock/llms.txt) | [Markdown](https://docs.speedscale.com/proxymock/how-it-works/architecture/index.md) | [Canonical page](https://docs.speedscale.com/proxymock/how-it-works/architecture/)

# Architecture

**proxymock** utilizes a [proxy](https://docs.speedscale.com/reference/glossary/#proxy) to capture traffic to and from your application.

Get a feel for the shape your local system with various **proxymock** configurations:

**No proxymock**

This is probably close what your setup looks like. A client making requests to your app's API (listening on port `8080` in this case) and your app making requests to various other services, APIs, databases, etc.

**Record Mocks**

With **proxymock** we can transparently capture outbound traffic, the requests your app makes to other services and the associated responses. Once captured these are called [mocks](https://docs.speedscale.com/reference/glossary/#mock) and are written to artifacts in a local directory.

Once the necessary env vars are set in the environment where "your app" is running outbound traffic from your app is routed through **proxymock** and captured in the process. Is is **not** necessary to modify your app.

**Record Tests**

With **proxymock** we can capture inbound traffic, the requests your client makes to your app the associated responses. Once captured these are called [tests](https://docs.speedscale.com/reference/glossary/#test) and are written to artifacts in a local directory.

Requests from the client are routed through **proxymock** and captured in the process, but unlike outbound traffic where we can just set env vars the client will need to target the proxy port instead of the app port. In this case that means making requests to `localhost:4143` instead of `localhost:8080`.

**Mock Server**

Once **proxymock** has created [mocks](https://docs.speedscale.com/reference/glossary/#mock) from outbound traffic it can be used as a [mock server](https://docs.speedscale.com/reference/glossary/#mock-server) to respond to requests from your app. Mock [signatures](https://docs.speedscale.com/proxymock/how-it-works/signature/) are generated from the mock artifacts captured earlier.

While dependencies can be fully replace by **proxymock**, there is a dotted line to indicate "passthrough", which is what happens when a request to the mock server does not match a [signature](https://docs.speedscale.com/proxymock/how-it-works/signature/). In that case the request is forwarded to the real resource.

**Replay / Load Generator**

Once **proxymock** has created [tests](https://docs.speedscale.com/reference/glossary/#test) from inbound traffic it can replay those requests back to your app. Requests are generated from the test artifacts captured earlier.

In this configuration the client is fully replaced by **proxymock** which makes requests to your app on port `8080`.

Send enough requests and this replay becomes a full [load generator](https://docs.speedscale.com/reference/glossary/#load-generator). See the **proxymock** flags for to increase the number of [VUs](https://docs.speedscale.com/reference/glossary/#vuser), run for a period of time, skip writing new files from replayed requests, etc.
