|
|
|
@@ -22,10 +22,11 @@ Holesail Browser is composed of three parts: a browser extension, a native host
|
|
|
|
|
┌─────────────────────────────────────────────────────────────────┐
|
|
|
|
|
│ Native Host (~/.holesail-browser/holesail-browser-host) │
|
|
|
|
|
│ │
|
|
|
|
|
│ ┌──────────┐ ┌──────────────────┐ ┌──────────────────────┐ │
|
|
|
|
|
│ │ host.js │ │ holesail- │ │ certificate- │ │
|
|
|
|
|
│ │ (command │ │ manager.js │ │ authority.js │ │
|
|
|
|
|
│ │ dispatch)│ │ (tunnel lifecycle│ │ (root CA + per-TLD │ │
|
|
|
|
|
│ ┌──────────────┐ ┌──────────────────┐ ┌──────────────────────┐ │
|
|
|
|
|
│ │ message- │ │ holesail- │ │ certificate- │ │
|
|
|
|
|
│ │ router.js │ │ manager/ │ │ authority.js │ │
|
|
|
|
|
│ │ (command │ │ (tunnel lifecycle│ │ (root CA + per-TLD │ │
|
|
|
|
|
│ │ dispatch) │ │ + state.json) │ │ wildcard certs, │ │
|
|
|
|
|
│ └────┬─────┘ │ + state.json) │ │ wildcard certs, │ │
|
|
|
|
|
│ │ └────────┬─────────┘ │ keychain install) │ │
|
|
|
|
|
│ │ │ └──────────────────────┘ │
|
|
|
|
@@ -59,10 +60,8 @@ Holesail Browser is composed of three parts: a browser extension, a native host
|
|
|
|
|
|
|
|
|
|
| File | Purpose |
|
|
|
|
|
|------|---------|
|
|
|
|
|
| `index.mjs` | Entry point. Bootstraps Bare globals, creates the native messaging `messenger`, wires `handleMessage` from `host.js`. Handles `SIGTERM`/`SIGINT` for graceful shutdown. |
|
|
|
|
|
| `index.mjs` | Entry point. Bootstraps Bare globals, creates the native messaging `messenger`, wires `handleMessage` from `host/message-router.js`. Handles `SIGTERM`/`SIGINT` for graceful shutdown. |
|
|
|
|
|
| `messenger.js` | Chrome/Firefox native messaging framing: 4-byte little-endian length prefix + UTF-8 JSON body. Max 1 MB per message. |
|
|
|
|
|
| `host.js` | Thin shim — re-exports `handleMessage` and `cleanup` from `host/message-router.js`. Kept at the top level so `index.mjs` requires it unchanged. |
|
|
|
|
|
| `holesail-manager.js` | Thin shim — re-exports the full API from `holesail-manager/index.js`. Kept at the top level so `host/message-router.js` requires it unchanged. |
|
|
|
|
|
| `https-proxy.js` | SNI-aware HTTPS reverse proxy on `127.0.0.1:8443`. Uses a pure-JS TLS ClientHello parser to extract the SNI hostname from each incoming connection, derives the wildcard parent domain, and presents a per-TLD wildcard cert. Supports any hostname depth (e.g. `i.love.hole.sail`). Returns a 502 HTML page for unknown hostnames. |
|
|
|
|
|
| `connect-proxy.js` | HTTP CONNECT proxy on `127.0.0.1:8442`. Accepts `CONNECT hostname:443`, replies `200 Connection established`, then pipes the raw TCP stream to `127.0.0.1:8443`. |
|
|
|
|
|
| `certificate-authority.js` | Generates a 2048-bit RSA root CA (10-year validity) using `node-forge`. Signs per-TLD wildcard domain certs on demand (1-year). Installs the CA into the OS trust store. Fingerprint-verifies to detect stale entries. |
|
|
|
|
@@ -90,7 +89,7 @@ Holesail Browser is composed of three parts: a browser extension, a native host
|
|
|
|
|
| `servers.js` | `startServer()`, `stopServer()`, `getServers()`. Manages Holesail server tunnels (server mode — exposes a local port to the P2P network). |
|
|
|
|
|
| `virtual-hosts.js` | `setVirtualHost()`, `removeVirtualHost()`, `getVirtualHosts()`, `getLocalBackend()`, `getLocalPortForHostname()`, `getVirtualHostMap()`. Manages virtual host client tunnels routed through the HTTPS proxy. |
|
|
|
|
|
| `service-tunnels.js` | `startServiceTunnel()`, `stopServiceTunnel()`, `getServiceTunnels()`. Manages direct TCP client tunnels (not HTTP-proxied). |
|
|
|
|
|
| `index.js` | Assembles all sub-modules, injects shared `saveState` and `emit` callbacks, exposes `restorePersistedState()` and `cleanup()`, and re-exports the complete original `holesail-manager.js` API. |
|
|
|
|
|
| `index.js` | Assembles all sub-modules, injects shared `saveState` and `emit` callbacks, exposes `restorePersistedState()` and `cleanup()`, and re-exports the complete holesail-manager API. |
|
|
|
|
|
|
|
|
|
|
### Extension (`extension/`)
|
|
|
|
|
|
|
|
|
@@ -193,7 +192,7 @@ HTTPS proxy (https-proxy.js) 127.0.0.1:8443
|
|
|
|
|
│ → { host: '127.0.0.1', port: 19042 }
|
|
|
|
|
│ Proxies HTTP request to 127.0.0.1:19042
|
|
|
|
|
▼
|
|
|
|
|
Holesail client tunnel (holesail-manager.js) 127.0.0.1:19042
|
|
|
|
|
Holesail client tunnel (holesail-manager) 127.0.0.1:19042
|
|
|
|
|
│ P2P connection via Noise protocol over Holesail DHT
|
|
|
|
|
▼
|
|
|
|
|
Remote peer (HTTP server)
|
|
|
|
@@ -276,7 +275,7 @@ See [NATIVE-HOST.md](NATIVE-HOST.md) for the full message type reference.
|
|
|
|
|
|------|-----------|-------------|
|
|
|
|
|
| 8443 | `https-proxy.js` | HTTPS proxy (SNI-aware TLS termination) |
|
|
|
|
|
| 8442 | `connect-proxy.js` | CONNECT proxy (PAC target) |
|
|
|
|
|
| 19000+ | `holesail-manager.js` | Virtual host and service tunnel client ports |
|
|
|
|
|
| 19000+ | `holesail-manager/` | Virtual host and service tunnel client ports |
|
|
|
|
|
| 20000+ | `ssh-manager.js` | SSH Holesail client tunnel ports |
|
|
|
|
|
| 21000+ | `ssh-manager.js` | SSH WebSocket server ports |
|
|
|
|
|
| 22000+ | `rdp-manager.js` | RDP/VNC Holesail client tunnel ports |
|
|
|
|
|