SuperTunnel is an open-source, browser-based VPN controller. It ships with:
- Web Extension (MV3): Background service worker, popup UI, and Vite+CRX build.
- Next.js UI: A modern React/Tailwind app scaffold for your server-side management UI.
The extension configures a browser proxy via the proxy API and talks to your server to fetch either a PAC script URL or fixed proxy settings. This keeps all traffic inside the browser, without requiring OS-level drivers.
- One-click connect/disconnect via popup
- Dynamic proxy configuration from your API: PAC or fixed proxy
- Status badge and basic persisted state in
chrome.storage - Vite + CRX build for a compact MV3 bundle
- Node.js 20.18+ and npm
- Chrome/Chromium (MV3), optionally Firefox (MV3 support varies)
npm installThe extension reads the API origin from VITE_API_ORIGIN at build-time.
Examples:
- PowerShell (Windows):
$env:VITE_API_ORIGIN = 'https://api.example.com'
npm run build:extension- .env file (Vite automatically loads):
VITE_API_ORIGIN=https://api.example.com
# Optional: generate simple placeholder icons
npm run gen:icons
# Build the web extension
npm run build:extensionThe bundle will be produced in dist-extension/.
- Open
chrome://extensions - Enable Developer mode
- Click “Load unpacked” and select the
dist-extensiondirectory
npm run devOpen http://localhost:9002.
-
extension/background.ts- Persists connection state in
chrome.storage.local - On “Connect”, posts to
POST {VITE_API_ORIGIN}/connect - Expects a response with either:
{ pacUrl: string }OR{ proxy: { host: string; port: number; scheme?: 'http'|'https' }, bypassList?: string[] }
- Applies the proxy via
chrome.proxy.settings.set
- Persists connection state in
-
extension/popup.html+extension/popup.ts- Simple UI to set endpoint/token and connect/disconnect
- Sends messages to the background worker (
get_state,connect,disconnect,set_endpoint,set_token)
-
extension/manifest.ts- MV3 manifest generated at build time
- Uses
VITE_API_ORIGINto populatehost_permissions
POST {API_ORIGIN}/connect
Content-Type: application/json
Authorization: Bearer <token> # optional
Body: { "client": "extension" }
200 OK
{ "pacUrl": "https://.../proxy.pac" }
- or -
{ "proxy": { "host": "127.0.0.1", "port": 8080, "scheme": "http" }, "bypassList": ["<local>"] }
If your API differs, update extension/background.ts accordingly.
npm run dev:extension– start Vite in watch mode for the extensionnpm run build:extension– build the MV3 extensionnpm run gen:icons– generate simple placeholder icons
The MV3 manifest requests:
proxy,storage,alarmsAndhost_permissionsbased onVITE_API_ORIGIN.
Contributions are welcome! Please:
- Open an issue to discuss substantial changes
- Submit a focused pull request with clear rationale
- Follow the existing code style and TypeScript conventions
By participating, you agree to uphold a respectful, inclusive environment. We recommend adopting the Contributor Covenant as a Code of Conduct.
If you discover a security issue, please report it privately first. Avoid filing public issues for sensitive vulnerabilities until a fix is available.
MIT. See LICENSE for details.
- Benny 01r [email protected]
- Irshad Siddi [email protected]