Use a HAR-file

This commit is contained in:
Zanie 2023-12-12 10:01:56 -06:00
parent 5565aef632
commit 8e437a9a37
3 changed files with 8 additions and 5 deletions

View File

@ -8,7 +8,7 @@
#
projectroot=$(realpath "$(dirname "$0")")
responsefile=$projectroot/responses.dat
responsefile=$projectroot/responses.har
mode=$1
shift

View File

@ -19,16 +19,18 @@ if [ -n "$*" ]; then
exit 1
fi
# Remove the file before starting
rm "$path" 2> /dev/null
# N.B. Additional options must be added _before_ the filter string
exec mitmdump \
-w "$path" \
--set stream_large_bodies=1000m \
--set hardump="$path" \
"~d pypi.org|files.pythonhosted.org|mitm.it"
# stream_large_bodies: must be set to a large value or large responses will not be recorded
# resulting in an unexpected file endings during replays
# hardump: we use a HAR file instead of the binary format (-w <path>) so it the output is
# human readable
# ~d: only interactions with package index domains should be recorded
# we also allow `mitm.it` so healthchecks succeed when replaying
# Helpful notes for development
# --flow-detail <0-4> can be used to adjust the amount information displayed about traffic

View File

@ -22,6 +22,7 @@ if [ -n "$*" ]; then
fi
exec mitmdump --server-replay "$path" \
--flow-detail 3 \
--server-replay-extra 500 \
--set connection_strategy=lazy