1123Javayanglei/vscode-chat-proxy/monitor does not have a README file

    Flow

    pub(all) struct Flow {
    id : Int
    start_ms : UInt64
    client_addr : String
    http_method : String
    target : String
    request_headers : Array[(String, String)]
    request_size : Int
    intercepted : Bool
    upstream : String
    request_body : Bytes
    request_truncated : Bool
    injected : Bool
    upstream_body : Bytes?
    upstream_truncated : Bool
    status : Int
    reason : String
    response_headers : Array[(String, String)]
    response_body : Bytes
    response_size : Int
    response_truncated : Bool
    end_ms : UInt64
    error : String?
    finished : Bool
    }

    One proxied request/response pair, as shown in the monitor UI.

    Flow::detail

    Full detail for the flow detail API (shared contract type).

    Flow::summary

    Summary row for the flow list API (shared contract type).

    FlowStore

    pub struct FlowStore {
    capacity : Int
    flows : Array[Flow]
    next_id : Int
    total : Int
    injected_total : Int
    }

    In-memory ring buffer of recent flows. The async runtime is single-threaded cooperative, so no locking is needed.

    FlowStore::begin

    fn FlowStore::begin(self : FlowStore, client_addr~ : String, http_method~ : String, target~ : String, request_headers~ : Array[(String, String)], request_body~ : Bytes, intercepted~ : Bool, upstream~ : String) -> Flow

    Register a new flow (request fully read, response pending).

    FlowStore::clear

    fn FlowStore::clear(self : FlowStore) -> Unit

    FlowStore::find

    fn FlowStore::find(self : FlowStore, id : Int) -> Flow?

    FlowStore::finish

    fn FlowStore::finish(self : FlowStore, flow : Flow) -> Unit

    Mark a flow complete (idempotent).

    FlowStore::list_response

    Flow list API payload (newest first, shared contract type).

    FlowStore::new

    fn FlowStore::new(capacity? : Int) -> FlowStore

    body_capture_limit

    let body_capture_limit : Int

    Max bytes stored per body (request or response) in the monitor.

    cap_bytes

    fn cap_bytes(b : Bytes) -> (Bytes, Bool)

    Store at most body_capture_limit bytes of a body.

    decode_chunked_body

    fn decode_chunked_body(raw : Bytes) -> Bytes

    Best-effort decode of a complete chunked body (for display only; the bytes forwarded to the client are never touched). Falls back to the raw bytes when the input is not valid chunked framing.

    run_web_server

    async fn run_web_server(addr :
    Addr
    , store : FlowStore) -> Unit

    Run the monitor web server (mitmweb-style UI + JSON API).