--- title: Getting Started Proxying description: Start MockServer as an HTTP/HTTPS proxy, configure clients to send traffic through it, and analyse or verify recorded requests and responses. shortTitle: Getting Started layout: page pageOrder: 1 section: 'Proxying' subsection: true sitemap: priority: 0.9 changefreq: 'monthly' lastmod: 2026-06-24T08:00:00+01:00 ---

As an in-path HTTP(S) proxy, MockServer records every request and response that flows through it — including HTTPS, which it can decrypt transparently with an auto-generated certificate. That means you can capture how a system really behaves and replay it as deterministic mocks without changing a line of application code: point your clients at MockServer, run your scenarios, then analyse, verify, or record-and-replay the captured traffic.
To use MockServer to analyse an existing system:

To use MockServer to verify requests:

For example code see the code examples folder in the git repository.
Inspecting AI agent traffic? If you want to see the HTTPS calls that Claude Code, OpenCode, or Python AI libraries send to LLM APIs and MCP servers, see Inspect AI Agent Traffic. It covers proxy setup, CA trust, and per-tool configuration for AI tools.
Proxying WebSockets? MockServer also proxies WebSocket connections. When a client opens a WebSocket (an HTTP Upgrade: websocket request) through MockServer and no matching WebSocket expectation exists, MockServer connects to the real upstream WebSocket server (over ws or wss), relays the handshake, and then relays messages in both directions until either side closes. The relayed frames (text, binary, ping, pong, close) are recorded alongside the connection so you can inspect them with recorded requests and in the dashboard. The number of frames recorded per connection is capped by the webSocketProxyMaxRecordedFrames configuration property (default 1000; set to 0 to record only the handshake). This currently covers HTTP/1.1 WebSocket upgrades over plain and TLS upstreams.
The page on configuring clients gives full details on how to configure clients to proxy requests via MockServer and includes code examples for the following clients: