fix: replace \\n with <br/> in mermaid node labels
This commit is contained in:
@@ -8,10 +8,10 @@ graph LR
|
|||||||
Client["Client"] -->|"OpenAI / Gemini API"| Proxy["Proxy :8741"]
|
Client["Client"] -->|"OpenAI / Gemini API"| Proxy["Proxy :8741"]
|
||||||
Proxy -->|"gRPC (dummy prompt)"| LS["Standalone LS"]
|
Proxy -->|"gRPC (dummy prompt)"| LS["Standalone LS"]
|
||||||
LS -->|"HTTPS :443"| MITM["MITM :8742"]
|
LS -->|"HTTPS :443"| MITM["MITM :8742"]
|
||||||
MITM -->|"Modified request\n(real prompt + tools)"| Google["Google API"]
|
MITM -->|"Modified request<br/>(real prompt + tools)"| Google["Google API"]
|
||||||
Google -->|"SSE response"| MITM
|
Google -->|"SSE response"| MITM
|
||||||
MITM -->|"Usage, errors,\nfunction calls"| Proxy
|
MITM -->|"Usage, errors,<br/>function calls"| Proxy
|
||||||
LS -.->|"iptables redirect\n(UID-scoped)"| MITM
|
LS -.->|"iptables redirect<br/>(UID-scoped)"| MITM
|
||||||
|
|
||||||
style Proxy fill:#7c3aed,color:#fff
|
style Proxy fill:#7c3aed,color:#fff
|
||||||
style MITM fill:#e94560,color:#fff
|
style MITM fill:#e94560,color:#fff
|
||||||
|
|||||||
@@ -4,16 +4,16 @@
|
|||||||
|
|
||||||
```mermaid
|
```mermaid
|
||||||
flowchart LR
|
flowchart LR
|
||||||
Client["Client\n(curl, SDK, etc.)"]
|
Client["Client<br/>(curl, SDK, etc.)"]
|
||||||
Proxy["Proxy\n:8741"]
|
Proxy["Proxy<br/>:8741"]
|
||||||
LS["Standalone LS\n:random"]
|
LS["Standalone LS<br/>:random"]
|
||||||
MITM["MITM Proxy\n:8742"]
|
MITM["MITM Proxy<br/>:8742"]
|
||||||
Google["Google API\ndaily-cloudcode-pa\n.googleapis.com"]
|
Google["Google API<br/>daily-cloudcode-pa<br/>.googleapis.com"]
|
||||||
|
|
||||||
Client -- "OpenAI / Gemini\nHTTP API" --> Proxy
|
Client -- "OpenAI / Gemini<br/>HTTP API" --> Proxy
|
||||||
Proxy -- "gRPC\n(protobuf)" --> LS
|
Proxy -- "gRPC<br/>(protobuf)" --> LS
|
||||||
LS -- "HTTPS :443\n(iptables redirect)" --> MITM
|
LS -- "HTTPS :443<br/>(iptables redirect)" --> MITM
|
||||||
MITM -- "TLS\n(BoringSSL)" --> Google
|
MITM -- "TLS<br/>(BoringSSL)" --> Google
|
||||||
|
|
||||||
style Proxy fill:#7c3aed,color:#fff
|
style Proxy fill:#7c3aed,color:#fff
|
||||||
style MITM fill:#dc2626,color:#fff
|
style MITM fill:#dc2626,color:#fff
|
||||||
@@ -63,7 +63,7 @@ sequenceDiagram
|
|||||||
```mermaid
|
```mermaid
|
||||||
graph TD
|
graph TD
|
||||||
subgraph "API Layer"
|
subgraph "API Layer"
|
||||||
mod_api["api/mod.rs\n(router)"]
|
mod_api["api/mod.rs<br/>(router)"]
|
||||||
completions["completions.rs"]
|
completions["completions.rs"]
|
||||||
responses["responses.rs"]
|
responses["responses.rs"]
|
||||||
gemini["gemini.rs"]
|
gemini["gemini.rs"]
|
||||||
@@ -75,18 +75,18 @@ graph TD
|
|||||||
end
|
end
|
||||||
|
|
||||||
subgraph "MITM Layer"
|
subgraph "MITM Layer"
|
||||||
proxy_mitm["proxy.rs\n(TLS termination)"]
|
proxy_mitm["proxy.rs<br/>(TLS termination)"]
|
||||||
h2["h2_handler.rs\n(HTTP/2 framing)"]
|
h2["h2_handler.rs<br/>(HTTP/2 framing)"]
|
||||||
intercept["intercept.rs\n(SSE parsing)"]
|
intercept["intercept.rs<br/>(SSE parsing)"]
|
||||||
modify["modify.rs\n(request injection)"]
|
modify["modify.rs<br/>(request injection)"]
|
||||||
store["store.rs\n(MitmStore)"]
|
store["store.rs<br/>(MitmStore)"]
|
||||||
proto_mitm["proto.rs\n(protobuf codec)"]
|
proto_mitm["proto.rs<br/>(protobuf codec)"]
|
||||||
ca["ca.rs\n(cert generation)"]
|
ca["ca.rs<br/>(cert generation)"]
|
||||||
end
|
end
|
||||||
|
|
||||||
subgraph "Core"
|
subgraph "Core"
|
||||||
main["main.rs"]
|
main["main.rs"]
|
||||||
backend["backend.rs\n(gRPC client)"]
|
backend["backend.rs<br/>(gRPC client)"]
|
||||||
session["session.rs"]
|
session["session.rs"]
|
||||||
trace["trace.rs"]
|
trace["trace.rs"]
|
||||||
warmup["warmup.rs"]
|
warmup["warmup.rs"]
|
||||||
@@ -97,7 +97,7 @@ graph TD
|
|||||||
subgraph "Standalone LS"
|
subgraph "Standalone LS"
|
||||||
spawn["spawn.rs"]
|
spawn["spawn.rs"]
|
||||||
discovery["discovery.rs"]
|
discovery["discovery.rs"]
|
||||||
stub["stub.rs\n(extension server)"]
|
stub["stub.rs<br/>(extension server)"]
|
||||||
end
|
end
|
||||||
|
|
||||||
subgraph "Protobuf"
|
subgraph "Protobuf"
|
||||||
|
|||||||
26
docs/mitm.md
26
docs/mitm.md
@@ -32,13 +32,13 @@ sequenceDiagram
|
|||||||
```mermaid
|
```mermaid
|
||||||
graph TD
|
graph TD
|
||||||
subgraph "MITM Module"
|
subgraph "MITM Module"
|
||||||
proxy["proxy.rs\nTLS termination\nSNI-based routing"]
|
proxy["proxy.rs<br/>TLS termination<br/>SNI-based routing"]
|
||||||
h2["h2_handler.rs\nHTTP/2 frame handling"]
|
h2["h2_handler.rs<br/>HTTP/2 frame handling"]
|
||||||
intercept["intercept.rs\nSSE parser\nUsage extraction"]
|
intercept["intercept.rs<br/>SSE parser<br/>Usage extraction"]
|
||||||
modify["modify.rs\nRequest injection\n(tools, params, images)"]
|
modify["modify.rs<br/>Request injection<br/>(tools, params, images)"]
|
||||||
store["store.rs\nMitmStore\nEvent channels"]
|
store["store.rs<br/>MitmStore<br/>Event channels"]
|
||||||
proto["proto.rs\nProtobuf codec"]
|
proto["proto.rs<br/>Protobuf codec"]
|
||||||
ca["ca.rs\nCA + dynamic certs"]
|
ca["ca.rs<br/>CA + dynamic certs"]
|
||||||
end
|
end
|
||||||
|
|
||||||
proxy --> h2
|
proxy --> h2
|
||||||
@@ -72,20 +72,20 @@ When the MITM proxy intercepts an outgoing request from the LS, it applies modif
|
|||||||
```mermaid
|
```mermaid
|
||||||
flowchart TD
|
flowchart TD
|
||||||
A["Original LS Request"] --> B{"Has tools?"}
|
A["Original LS Request"] --> B{"Has tools?"}
|
||||||
B -- Yes --> C["Inject tool definitions\n+ toolConfig"]
|
B -- Yes --> C["Inject tool definitions<br/>+ toolConfig"]
|
||||||
B -- No --> D{"Has generation params?"}
|
B -- No --> D{"Has generation params?"}
|
||||||
C --> D
|
C --> D
|
||||||
D -- Yes --> E["Inject temperature, top_p,\nmax_output_tokens, stop_sequences,\nfrequency/presence_penalty"]
|
D -- Yes --> E["Inject temperature, top_p,<br/>max_output_tokens, stop_sequences,<br/>frequency/presence_penalty"]
|
||||||
D -- No --> F{"Has image?"}
|
D -- No --> F{"Has image?"}
|
||||||
E --> F
|
E --> F
|
||||||
F -- Yes --> G["Inject inlineData\n(base64) into user parts"]
|
F -- Yes --> G["Inject inlineData<br/>(base64) into user parts"]
|
||||||
F -- No --> H{"Has tool results?"}
|
F -- No --> H{"Has tool results?"}
|
||||||
G --> H
|
G --> H
|
||||||
H -- Yes --> I["Inject functionResponse\nparts"]
|
H -- Yes --> I["Inject functionResponse<br/>parts"]
|
||||||
H -- No --> J{"Google Search?"}
|
H -- No --> J{"Google Search?"}
|
||||||
I --> J
|
I --> J
|
||||||
J -- Yes --> K["Enable Google Search\ngrounding tool"]
|
J -- Yes --> K["Enable Google Search<br/>grounding tool"]
|
||||||
J -- No --> L["Replace user text\nwith real input"]
|
J -- No --> L["Replace user text<br/>with real input"]
|
||||||
K --> L
|
K --> L
|
||||||
L --> M["Update Content-Length"]
|
L --> M["Update Content-Length"]
|
||||||
M --> N["Forward to Google"]
|
M --> N["Forward to Google"]
|
||||||
|
|||||||
Reference in New Issue
Block a user