# quiteafancyemerald/invisiproxy architecture

> Architecture diagram of the GitHub repository quiteafancyemerald/invisiproxy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/quiteafancyemerald/invisiproxy
- Repository: https://github.com/quiteafancyemerald/invisiproxy

## Overview

InvisiProxy is a browser-based web proxy: a visitor opens the service, selects a proxy mode, and browses a target through that mode’s browser-side proxy machinery. The sampled server serves pages and worker scripts, while its route and template modules prepare page responses. Ultraviolet’s worker excerpt shows upstream fetching and response rewriting; the Scramjet blacklist worker shows request filtering and dispatch. README claims also cover Tor/Onion routing, ad blocking, and privacy settings, but their implementation links are not fully visible in the excerpts.

Main entry points: [`src/server.mjs`](https://github.com/quiteafancyemerald/invisiproxy/blob/master/src/server.mjs) (HTTP Service), [`views/uv/uv.sw.js`](https://github.com/quiteafancyemerald/invisiproxy/blob/master/views/uv/uv.sw.js) (Ultraviolet Worker), [`views/sw-blacklist.js`](https://github.com/quiteafancyemerald/invisiproxy/blob/master/views/sw-blacklist.js) (Scramjet Filter Worker), [`src/templates.mjs`](https://github.com/quiteafancyemerald/invisiproxy/blob/master/src/templates.mjs) (Template Assembly)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Web Service"]
  node_httpserver["HTTP Service<br/>[server.mjs]"]
  node_routeconfig["Route Configuration<br/>[routes.mjs]"]
  node_wisp["Wisp Tunnel<br/>[server.mjs]"]
end

subgraph group_render["Page Preparation"]
  node_templates["Template Assembly<br/>[templates.mjs]"]
  node_rewrites["Source Rewriting"]
end

subgraph group_proxy["Proxy Modes"]
  node_uvpage["Ultraviolet Page<br/>[ultraviolet.html]"]
  node_uvworker["Ultraviolet Worker<br/>[uv.sw.js]"]
  node_uvhandler["Ultraviolet Handler<br/>[uv.handler.js]"]
  node_scramjetpage["Scramjet Page<br/>[scramjet.html]"]
  node_scramjetworker["Scramjet Filter Worker<br/>[sw-blacklist.js]"]
  node_scramjetcontroller["Scramjet Controller"]
end

subgraph group_features["Browsing Features"]
  node_pageviews["Proxy Pages"]
  node_settings["Privacy Settings<br/>[settings.html]"]
  node_adblocklist["Ad Blocklist<br/>[blacklist.txt]"]
end

node_visitor(("Visitor"))
node_upstream(("Target Websites"))

node_visitor -->|"opens service"| node_httpserver
node_httpserver -->|"uses routes"| node_routeconfig
node_httpserver -->|"reads files"| node_templates
node_templates -->|"paints content"| node_rewrites
node_httpserver -->|"serves pages"| node_pageviews
node_httpserver -->|"serves proxy page"| node_uvpage
node_httpserver -->|"serves proxy page"| node_scramjetpage
node_visitor -.->|"selects mode"| node_uvpage
node_visitor -.->|"selects mode"| node_scramjetpage
node_uvworker -->|"fetches requests"| node_upstream
node_uvworker -.->|"uses rewriting"| node_uvhandler
node_scramjetworker -->|"loads domains"| node_adblocklist
node_scramjetworker -->|"dispatches requests"| node_scramjetcontroller
node_visitor -.->|"configures browsing"| node_settings
node_httpserver -->|"routes upgrades"| node_wisp
node_visitor -.->|"browses via proxy"| node_upstream

click node_httpserver "https://github.com/quiteafancyemerald/invisiproxy/blob/master/src/server.mjs"
click node_routeconfig "https://github.com/quiteafancyemerald/invisiproxy/blob/master/src/routes.mjs"
click node_pageviews "https://github.com/quiteafancyemerald/invisiproxy/tree/master/views/pages/proxnav"
click node_templates "https://github.com/quiteafancyemerald/invisiproxy/blob/master/src/templates.mjs"
click node_rewrites "https://github.com/quiteafancyemerald/invisiproxy/blob/master/src/source-rewrites.mjs"
click node_uvpage "https://github.com/quiteafancyemerald/invisiproxy/blob/master/views/pages/proxnav/ultraviolet.html"
click node_uvworker "https://github.com/quiteafancyemerald/invisiproxy/blob/master/views/uv/uv.sw.js"
click node_uvhandler "https://github.com/quiteafancyemerald/invisiproxy/blob/master/views/uv/uv.handler.js"
click node_scramjetpage "https://github.com/quiteafancyemerald/invisiproxy/blob/master/views/pages/proxnav/scramjet.html"
click node_scramjetworker "https://github.com/quiteafancyemerald/invisiproxy/blob/master/views/sw-blacklist.js"
click node_wisp "https://github.com/quiteafancyemerald/invisiproxy/blob/master/src/server.mjs"
click node_settings "https://github.com/quiteafancyemerald/invisiproxy/blob/master/views/pages/misc/deobf/settings.html"
click node_adblocklist "https://github.com/quiteafancyemerald/invisiproxy/blob/master/views/assets/txt/blacklist.txt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_httpserver,node_routeconfig,node_wisp toneBlue
class node_templates,node_rewrites toneAmber
class node_uvpage,node_uvworker,node_uvhandler,node_scramjetpage,node_scramjetworker,node_scramjetcontroller toneMint
class node_pageviews,node_settings,node_adblocklist toneRose
class node_visitor,node_upstream toneIndigo
```

## Components

### Web Service

- [HTTP Service](https://github.com/quiteafancyemerald/invisiproxy/blob/master/src/server.mjs): `src/server.mjs`
- [Route Configuration](https://github.com/quiteafancyemerald/invisiproxy/blob/master/src/routes.mjs): `src/routes.mjs`
- [Wisp Tunnel](https://github.com/quiteafancyemerald/invisiproxy/blob/master/src/server.mjs): `src/server.mjs`

### Page Preparation

- [Template Assembly](https://github.com/quiteafancyemerald/invisiproxy/blob/master/src/templates.mjs): `src/templates.mjs`
- [Source Rewriting](https://github.com/quiteafancyemerald/invisiproxy/blob/master/src/source-rewrites.mjs): `src/source-rewrites.mjs`

### Proxy Modes

- [Ultraviolet Page](https://github.com/quiteafancyemerald/invisiproxy/blob/master/views/pages/proxnav/ultraviolet.html): `views/pages/proxnav/ultraviolet.html`
- [Ultraviolet Worker](https://github.com/quiteafancyemerald/invisiproxy/blob/master/views/uv/uv.sw.js): `views/uv/uv.sw.js`
- [Ultraviolet Handler](https://github.com/quiteafancyemerald/invisiproxy/blob/master/views/uv/uv.handler.js): `views/uv/uv.handler.js`
- [Scramjet Page](https://github.com/quiteafancyemerald/invisiproxy/blob/master/views/pages/proxnav/scramjet.html): `views/pages/proxnav/scramjet.html`
- [Scramjet Filter Worker](https://github.com/quiteafancyemerald/invisiproxy/blob/master/views/sw-blacklist.js): `views/sw-blacklist.js`
- **Scramjet Controller**

### Browsing Features

- [Proxy Pages](https://github.com/quiteafancyemerald/invisiproxy/tree/master/views/pages/proxnav): `views/pages/proxnav`
- [Privacy Settings](https://github.com/quiteafancyemerald/invisiproxy/blob/master/views/pages/misc/deobf/settings.html): `views/pages/misc/deobf/settings.html`
- [Ad Blocklist](https://github.com/quiteafancyemerald/invisiproxy/blob/master/views/assets/txt/blacklist.txt): `views/assets/txt/blacklist.txt`

### Other components

- **Visitor**
- **Target Websites**

## Connections

- Visitor → HTTP Service: opens service (evidence: `README.md`)
- HTTP Service → Route Configuration: uses routes (evidence: `src/server.mjs`)
- HTTP Service → Template Assembly: reads files (evidence: `src/server.mjs`)
- Template Assembly → Source Rewriting: paints content (evidence: `src/templates.mjs`)
- HTTP Service → Proxy Pages: serves pages (evidence: `src/server.mjs`)
- HTTP Service → Ultraviolet Page: serves proxy page (evidence: `src/server.mjs`)
- HTTP Service → Scramjet Page: serves proxy page (evidence: `src/server.mjs`)
- Visitor → Ultraviolet Page: selects mode (evidence: `README.md`)
- Visitor → Scramjet Page: selects mode (evidence: `README.md`)
- Ultraviolet Worker → Target Websites: fetches requests (evidence: `views/uv/uv.sw.js`)
- Ultraviolet Worker → Ultraviolet Handler: uses rewriting
- Scramjet Filter Worker → Ad Blocklist: loads domains (evidence: `views/sw-blacklist.js`)
- Scramjet Filter Worker → Scramjet Controller: dispatches requests (evidence: `views/sw-blacklist.js`)
- Visitor → Privacy Settings: configures browsing (evidence: `README.md`)
- HTTP Service → Wisp Tunnel: routes upgrades (evidence: `src/server.mjs`)
- Visitor → Target Websites: browses via proxy (evidence: `README.md`)
