srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorsrdusr <[email protected]>2026-05-19 22:15:00 +0200
committersrdusr <[email protected]>2026-05-19 22:15:00 +0200
commit3f2c38c4b62f3502dcb64e7b050f3de049518542 (patch)
tree6d698821ae24a83bba2ec27396edecbac7b47eb7 /README.md
parent4fa511ac5f2aa422456c49610a2cf29dfee46dfd (diff)
downloadmitmux-3f2c38c4b62f3502dcb64e7b050f3de049518542.tar.gz
mitmux-3f2c38c4b62f3502dcb64e7b050f3de049518542.zip
Export a history entry to a plain-text file
No way existed to get data out of mitmux at all short of querying the SQLite file directly. 'e' from Detail view exports the selected entry's raw request and response bytes to a file - a modal path-prompt (same pattern as Intruder's grep-match/extract edit buffers: enter writes and confirms, esc cancels), prefilled with a sensible default filename (mitmux-entry-<id>.txt). Deliberately plain text, not a structured format: for "attach this to a report" or "grep it later" - the actual use case - the raw bytes as text are the whole point, matching this tool's own raw-bytes-first philosophy rather than reformatting them into something else first. Detail-view-only (like pretty-print), not also from the history list: exporting needs the full EntryDetail with raw bytes, which is already loaded there, so this avoids adding a second load-then-prompt path for one keystroke of convenience. Each side is annotated when it isn't a wire-exact capture - "(truncated - hit capture size limit)" or "(reconstructed, not wire-exact)", matching the same distinction Detail view's own labels already make - so the exported file carries the same trust information the UI shows, not a blanker claim that could mislead whoever reads the export later without the tool's own context. cmd/mitmux/export.go: exportEntryText (pure formatting, unit tested including the non-exact annotation paths) and writeExportFile (a thin os.WriteFile wrapper - a relative path resolves against the process's CWD, same as any other command-line tool; no ~ expansion, that's shell behavior, not something a bare file write should reimplement). Verified live in tmux: exported a real captured entry, confirmed the written file byte-for-byte via cat - correct header, exact request and response bytes including chunked body - and confirmed esc correctly cancels without writing anything. go build/vet/gofmt/test/mod tidy all clean.
Diffstat (limited to 'README.md')
-rw-r--r--README.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/README.md b/README.md
index ccb770c..df744ba 100644
--- a/README.md
+++ b/README.md
@@ -168,7 +168,9 @@ below is enough to get going.
`tab` switches request/response, `p` toggles pretty-printed JSON on the
response (display-only - never touches the stored or resent bytes), `c`
mark/compare (same as the history list), `r`/`i` jump straight to
-Repeater/Intruder seeded from this entry, `esc` back.
+Repeater/Intruder seeded from this entry, `e` exports the entry
+(request and response, raw bytes, plain text - type a path and press
+enter), `esc` back.
### Comparer