Co-authored-by: Copilot <copilot@github.com>
2.7 KiB
Exit Node Deployment Guide (Val Town / Cloudflare / Deno)
This guide explains how to deploy an exit node for MasterHttpRelayVPN on free platforms.
Traffic path:
Browser -> Local Proxy -> Apps Script -> Exit Node -> Target Website
Use this when destinations block Google datacenter egress.
1) Choose One Provider
- Val Town
- Cloudflare Workers
- Deno Deploy
You only need one provider.
2) Set PSK In Code
Each template includes:
const PSK = "CHANGE_ME_TO_A_STRONG_SECRET";
Replace that value with a long random secret.
Important:
- Use the same PSK in your local config under exit_node.psk.
- Never share your deployed URL together with a valid PSK.
3) Deploy On Val Town
Source file: apps_script/valtown.ts
Steps:
- Sign in at https://www.val.town
- Create a new Val (TypeScript HTTP endpoint).
- Paste content from apps_script/valtown.ts.
- Set the PSK constant in the code.
- Save and deploy.
- Copy your public URL, usually like https://YOUR-NAME.web.val.run
4) Deploy On Cloudflare Workers
Source file: apps_script/cloudflare_worker.js
Steps:
- Sign in at https://dash.cloudflare.com
- Go to Compute -> Workers & Pages.
- Create Application -> Start with Hello World -> Deploy -> Edit Code.
- Replace code with apps_script/cloudflare_worker.js content.
- Set PSK constant in code.
- Deploy.
- Copy URL, usually like https://YOUR-WORKER.YOUR-SUBDOMAIN.workers.dev
5) Deploy On Deno Deploy
Source file: apps_script/deno_deploy.ts
Steps:
- Sign in at https://dash.deno.com
- Create new project.
- Upload or paste apps_script/deno_deploy.ts.
- Set PSK constant in code.
- Deploy.
- Copy URL, usually like https://YOUR-PROJECT.deno.dev
6) Configure MasterHttpRelayVPN
Update config.json:
{ "exit_node": { "enabled": true, "provider": "valtown", "url": "https://YOUR-NAME.web.val.run", "psk": "CHANGE_ME_TO_A_STRONG_SECRET", "mode": "full", "hosts": [ "chatgpt.com", "openai.com", "claude.ai", "anthropic.com" ] } }
Provider values:
- valtown
- cloudflare
- deno
If mode is selective, only hosts listed in hosts use the exit node. If mode is full, all relayed traffic uses the exit node.
7) Quick Test
- Start app: python main.py
- Ensure proxy is set in browser.
- Open a site known to require non-Google egress.
- If it fails, check:
- provider and url are correct
- psk matches exactly between config and deployed code
- exit_node.enabled is true
Troubleshooting
- unauthorized: PSK mismatch
- method_not_allowed: endpoint got non-POST request directly (normal when opened in browser)
- bad_url: malformed target URL from relay payload
- timeout or 5xx: temporary provider issue, redeploy and retry