feat(truapi-debugger): loopback WebSocket server and web inspector - #537
Draft
decrypto21 wants to merge 1 commit into
Draft
feat(truapi-debugger): loopback WebSocket server and web inspector#537decrypto21 wants to merge 1 commit into
decrypto21 wants to merge 1 commit into
Conversation
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.
Stacked on the engine PR. Design doc: #315.
The standalone inspector: a loopback WS + HTTP server the host dials, serving a Network-tab-style web inspector. Three files.
What
v,codec,schema,channelId, product-vantagedir, base64frame,dropped. Every refusal is counted and surfaced on/stats; a silently discarded envelope is indistinguishable from a host that never dialled./traces,/op-list,/stats,/op,/view,/frame. The page renders from these, and any other client (a script,curl, a headless check) goes through the same ones, so no two consumers can disagree.Originis a loopback host (a cross-origin page can otherwise dial a loopback server and drive the decoder); rejects requests whoseHostis not an exact loopback name (DNS rebinding); caps payload size. TheOriginallowlist excludes the product sandbox realm, which is a legitimate origin for a page that dials in but must never be trusted to inject frames.What it looks like
Aggregate summary strip, operation list with filter/sort/channel pills and health badges:
Opening an operation decodes every frame to its SCALE-typed value inline — no click-to-decode, no toggle, because a dev-only tool decodes everything by default:
Verification
tsc -bclean, 157 tests. The origin and Host gates are unit-tested separately from the server, across uppercase, trailing dots, punycode, IPv6, embedded credentials and integer IPv4 forms.