Package org.microproxy.extras
Class ClientReplay
java.lang.Object
org.microproxy.extras.ClientReplay
Sends recorded requests again, as mitmproxy's
client_replay: each goes to the proxy's own
listener as an ordinary client request, so every filter, addon, script, cache and recorder of the
proxy applies to it, and the proxy reaches the server (over TLS for https:// URLs).
HttpProxyServer proxy = bootstrap.start();
ClientReplay.Result result = ClientReplay.builder(proxy.getListenAddress()).concurrency(4).build()
.replay(RecordedExchange.load(Path.of("flows.har")));
Requests are sent in absolute form (GET https://host/path HTTP/1.1) with their
recorded headers and body, except hop-by-hop and framing headers: Host follows the URL,
Content-Length the body, and each request has a connection of its own (
Connection: close). At most ClientReplay.Builder.concurrency requests are in flight at once, and
they start in recorded order. The responses are read and discarded; ClientReplay.Result has their
statuses. A proxy that requires authentication refuses them with 407.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classConfigures aClientReplay.static final recordWhat a replay did. -
Method Summary
Modifier and TypeMethodDescriptionstatic ClientReplay.Builderbuilder(InetSocketAddress proxy) Starts a builder for replaying through the proxy listening atproxy.replay(List<RecordedExchange> exchanges) Sendsexchanges' requests through the proxy and waits for every response.
-
Method Details
-
builder
Starts a builder for replaying through the proxy listening atproxy.- Parameters:
proxy- the proxy's listen address- Returns:
- a new builder
-
replay
Sendsexchanges' requests through the proxy and waits for every response.- Parameters:
exchanges- the recorded exchanges- Returns:
- the statuses the requests got
- Throws:
InterruptedException- if interrupted while waiting
-