Package org.microproxy.extras
Class HarRecorder.Builder
java.lang.Object
org.microproxy.extras.HarRecorder.Builder
- Enclosing class:
HarRecorder
Configures a
HarRecorder.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates the recorder; a streaming one creates its file now.content(boolean content) Whether to record bodies (default true).filter(FlowFilter filter) Records only the exchangesfiltermatches (as mitmproxy'ssave_stream_filter); default all.maxBodySize(int bytes) The most bytes kept of each body (default 1 MiB); the rest is counted but not recorded.stream(boolean stream) Writes each entry to the file as it completes, rather than keeping entries in memory untilHarRecorder.close()(default false).
-
Method Details
-
filter
Records only the exchangesfiltermatches (as mitmproxy'ssave_stream_filter); default all. Body matchers see the captured bodies.- Parameters:
filter- the exchanges to record- Returns:
- this builder
-
maxBodySize
The most bytes kept of each body (default 1 MiB); the rest is counted but not recorded.- Parameters:
bytes- the limit per request or response body- Returns:
- this builder
-
content
Whether to record bodies (default true). Without them the recorder reads heads only and bodies keep the proxy's fast path; sizes then come fromContent-Length.- Parameters:
content- whether to capture bodies- Returns:
- this builder
-
stream
Writes each entry to the file as it completes, rather than keeping entries in memory untilHarRecorder.close()(default false).- Parameters:
stream- whether to stream entries to the file- Returns:
- this builder
-
build
Creates the recorder; a streaming one creates its file now.- Returns:
- the recorder
- Throws:
IOException- if a streamed file cannot be created
-