diff options
| author | srdusr <[email protected]> | 2024-08-29 22:03:00 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2024-08-29 22:03:00 +0200 |
| commit | 70f675e59ac4bb0e469ca0073f8cc0506b17677e (patch) | |
| tree | e3a525b26dfcf16ce4f9bde97b1408a373d87944 /go.mod | |
| parent | 8d15c2e0b326933f8fc912e3b13f37e78a9bc0b6 (diff) | |
| download | mitmux-70f675e59ac4bb0e469ca0073f8cc0506b17677e.tar.gz mitmux-70f675e59ac4bb0e469ca0073f8cc0506b17677e.zip | |
Repeater: raw-byte send/resend
Implements build-order step 4, the feature the plan calls out as used
daily. internal/proxy/repeat.go adds Server.Repeat(scheme, host, raw):
dials fresh (HTTP/1.1-only - raw edited text has no equivalent in
HTTP/2's binary framing), writes raw exactly as given with no framing
correction or header injection, and captures the exact response bytes.
This is deliberately separate from forward()'s parsed-*http.Request path
since Repeater's entire point is letting a malformed/edited request
reach the wire unmodified.
Repeater sends are recorded to the same history table as proxy traffic
(added a "source" column: "proxy" vs "repeater") so they show up in the
unified history view and the live subscribe stream, not a separate silo.
internal/ipc gains a "repeat" request/response pair; cmd/mitmuxd wires
proxy.Server into ipc.NewServer via a small Repeater interface so the
daemon keeps owning all network I/O and the TUI stays a thin client.
cmd/mitmux gains a repeater view (bubbles/textarea for the editable raw
request, a read-only viewport for the response), reachable with 'r' from
either the list or detail view, ctrl+r to send.
One real bug found via testing: bubbles/textarea only understands LF,
but HTTP/1.1 requires CRLF, so loading raw bytes straight into it split
each line in two on render. Fixed by normalizing CRLF<->LF at the editor
boundary only (load: strip \r; send: restore it) - documented as a
narrow, known trade-off for bodies with their own embedded LF line
breaks, which is the cost of being able to edit raw HTTP as text at all.
Verified live: edited and sent a plain-HTTP repeater request (confirmed
in SQLite that the edit - including an intentional extra blank line from
imprecise cursor navigation during testing - went out completely
unmodified, which is the correct behavior: mitmux must never "fix" what
the user typed), and sent an HTTPS repeater request against a freshly
captured entry, both getting real 200 responses with exact response
bytes back.
Diffstat (limited to 'go.mod')
| -rw-r--r-- | go.mod | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -11,6 +11,7 @@ require ( ) require ( + github.com/atotto/clipboard v0.1.4 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/charmbracelet/colorprofile v0.4.1 // indirect github.com/charmbracelet/x/ansi v0.11.6 // indirect |