---
title: "Lifecycle | Speedscale Docs"
description: "Explore the Lifecycle of proxymock to learn how to record, replay, and manage traffic for effective API testing and mocking with Speedscale."
canonical: "https://docs.speedscale.com/proxymock/how-it-works/lifecycle/"
---

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

# Lifecycle

Using **proxymock** starts with recording [traffic](https://docs.speedscale.com/reference/glossary/#traffic). See the `proxymock record` command. Recorded traffic is stored in files under a timestamped directory such as `proxymock/recorded-<timestamp>`, relative to wherever proxymock was run, unless `--out` is specified.

Traffic going to (tests), and coming from (mocks), your app can be recorded. The recorded traffic that went to your app can be replayed with `proxymock replay`. The recorded traffic that went from your app to external resources can be used to create a [mock server](https://docs.speedscale.com/reference/glossary/#mock-server) with `proxymock mock`.

When running `proxymock replay` or `proxymock mock` new requests are also recorded by default to `proxymock/results/replayed-<timestamp>` or `proxymock/results/mocked-<timestamp>`, unless disabled or overridden with CLI flags.

<a id="mock-server-lifecycle"></a>

## Mock Server Lifecycle

Speedscale's [mock server](https://docs.speedscale.com/reference/glossary/#mock-server) uses the outbound (egress) traffic of your application to create a mock server.

Each request received by the mock server is translated into a [signature](https://docs.speedscale.com/proxymock/how-it-works/signature/) to make it quickly identifiable. This is visible in [RRPair](https://docs.speedscale.com/reference/glossary/#rrpair) files and can be modified to change the matching criteria.

The signature is a map of identifiers which can be matched against incoming requests. When a request matches the associated response is sent back to your app.

<a id="updating-the-mock-server"></a>

## Updating the Mock Server

**proxymock** files will be read and automatically compiled every time a **proxymock** command is run so files can be changed on the fly. This means you can change the details of a test or mock by modifying the appropriate file and re-running **proxymock**. Request and response data can also be inspected and modified from `proxymock web`.

<a id="sharing-traffic"></a>

## Sharing Traffic

[RRPair](https://docs.speedscale.com/reference/glossary/#rrpair) files can be shared directly by copying them between machines. They can also be sent to the Speedscale cloud with the `proxymock cloud push snapshot` command. This creates a [snapshot](https://docs.speedscale.com/reference/glossary/#snapshot), which is easily pulled to other machines, or can be used to create automated replays in environments like Kubernetes which support such automation.

**proxymock** does support being embedded into a CI/CD pipeline but requires a commercial license. You can learn more about `proxymock push` and `proxymock pull` in the [Speedscale Enterprise](https://docs.speedscale.com/) documentation.
