Repository navigation
feat: rules, breakpoints, throttling, and capture from other devices (0.8.0) - #22
Merged
Merged
Conversation
One matcher (scheme, host glob, port, path glob, method, query) serves everything below. Rules, kept in <data>/rules.json, ordered, each with its own switch and one global switch: rewrite (request and response headers, host, path, query, status, body find and replace on the decoded body), map remote, map local (a file, or a folder the matched path maps under, never outside it and never FormNET's data folder), and block (403 naming the rule, or drop). Rules change HTTPS only where it is opened, never tunnels or WebSocket frames, and never FormNET's own addresses. Every flow a rule touched names it. Breakpoints are rules too: a matching exchange pauses at the request, the response or both; the page sees it on the stream and continues it, edited or not, or aborts it. A forgotten one goes on by itself after a timeout (60 s by default) with a note, and beyond a limit (20) matching exchanges pass with a note, so nothing hangs a program for ever. Throttling: presets (3G, 4G, slow Wi-Fi) or custom rates and latency, for every host or a host list, one token bucket per direction, both for opened HTTP and for tunnels; FormNET's own page is never slowed. Capture from other devices (the owner's rule): loopback stays the default. A switch, off by default and needing at least one allowed address or range, also opens the PROXY on this computer's network addresses; the API and the page stay on loopback for ever. Any other client is closed before anything is read, and counted. While it is on, http://formnet.cert/ through the proxy serves the root certificate (PEM and DER, never the key) so a phone can install it. Another device may not reach this computer's loopback addresses. CLAUDE.md and the README say where the one exception to loopback is. Run on Linux: gofmt, go vet for three systems, go test, the five cross-compiles, a race build under load (0 races); every rule action through the proxy, the map_local escapes refused; a request breakpoint edited and continued, a response breakpoint aborted, a forgotten one released after its timeout; the throttle measured at 96 percent of a custom rate both ways; remote capture from the workspace's own network address, an address outside the list closed unread, formnet.cert answering, and the API still on loopback only. Not run: a phone, macOS and Windows firewalls (TEST_PLAN).
…ndow Preferences gains three sections. Rules: the global switch, the server's note when HTTPS is not opened, and the ordered list (each rule's own switch, drag or up and down, edit, duplicate, delete), with a kind filter; the rule editor keeps every type's fields in one fixed-size box and marks the field a refusal names. The breakpoint timeout and limit sit there too. Throttle: the switch, the presets with their numbers, custom rates and latency, and a host list. Other devices: the switch, which cannot turn on with an empty allow list and says why, the list, the address and port to type into a phone, and plain steps for iPhone, iPad, Android and another computer to install the root from http://formnet.cert/. A Tools menu, after Charles's: Enable Rules (Alt+Cmd+K, Ctrl+Alt+K), Rewrite, Map Local, Map Remote, Block List, Breakpoints (Alt+Cmd+B, Ctrl+Alt+B), Breakpoint Rules, Throttle and Other Devices. The Breakpoints panel opens by itself when an exchange pauses, without taking focus from what is being typed: the paused list in fixed slots, a countdown to each deadline, an editor for the request (method, URL, headers, body) or the response (status, headers, body), Continue with only the changed fields, Continue unchanged, and Abort; outcomes come from the server's stream. Flows marks paused, rule-touched and throttled rows; the detail shows the rules and notes, Make a Rule from a flow, and Open Breakpoints. Status bar chips in reserved slots (n paused, Rules, the throttle preset, Other devices) open their panel. The System Proxy switch no longer disables itself while saving, which dropped focus out of Preferences so Esc stopped closing it. The new strings read in English in the other languages until the translation pass. Measured in Chromium with the CPU throttled 4x, layout-shift entries: every section opened from the menus and the chips, one rule of each kind made and run through the proxy, Enable Rules from the menu and the shortcut, a pause arriving while typing in the Flows filter, continue, abort and timeout, Make a Rule, the throttle and other devices: 0 each. No console errors. The window test 6 of 6.
Every version site moves to 0.8.0: Makefile, the README badge, web/package.json and its lock, src-tauri/tauri.conf.json, and src-tauri/Cargo.toml and its lock. CHANGELOG.md has the section for this version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: rules, breakpoints, throttling, and capture from other devices (0.8.0)
Built on 0.7.0 (
feat/system-proxy-0.7.0). If the earlier pull requests are not merged yet, this zip carries their commits too.Summary
<data>/rules.json, ordered, each with its own switch and one global switch: rewrite (headers both ways, host, path, query, status, body find and replace), map remote, map local (a file, or a folder confined to itself and never FormNET's data folder), block (403 naming the rule, or drop). One matcher serves every feature. Rules change HTTPS only where it is opened, never tunnels, WebSocket frames or FormNET's own addresses; every flow a rule touched names it.http://formnet.cert/serves the root (never the key) so a phone can install it.CLAUDE.mdand the README say where the one exception to loopback is.Commits
Hashes change when the commits are signed.
Version
v0.8.0 (release commit is last). Bumped:
Makefile, the README badge,web/package.jsonand its lock,src-tauri/tauri.conf.json,src-tauri/Cargo.tomland its lock.Checks
Run on Linux:
npm ci,npm audit(0 found),make check,make test,make build, the four cross-compiles, the window test (6 of 6),cargo check --lockedfor the Linux, Windows and both macOS targets (no Rust warning). Each commit builds, vets and type-checks on its own..., encoded.., symlinks out, the data folder) refused; a request breakpoint edited and continued, a response breakpoint aborted, a forgotten one released after its timeout; the throttle at 96,321 B/s down against 100,000 set and 48,153 up against 50,000, 200 ms latency; remote capture from the workspace's own network address, a client outside the list closed unread,formnet.certanswering PEM and DER and refusing the key, the API still on loopback only. A race build under load: 0 races.Not run: a phone; macOS and Windows firewalls; HTTPS rules against a trusted upstream. The new strings read in English in the other languages until the translation pass. The steps are in
TEST_PLAN.mdin the planning sidecar.Merging
Merge with a merge commit so each commit and its signature stays. Do not squash.