English | 简体中文
A lightweight self-hosted HTTP gateway for publishing internal web services through Cloudflare Tunnel, with a simple web admin panel and subdomain-based routing.
Flux Gate lets you:
- expose internal web services through Cloudflare Tunnel
- route different services with different subdomains
- manage routes from a web UI
- protect the admin panel and routed services with default credentials, while allowing per-route overrides
- optionally set a custom username/password or no password for each forwarded route
- pause and re-enable each forwarded route individually
- switch the dashboard between Chinese and English
Example:
https://your-domain.com→ admin panelhttps://demo.your-domain.com→ your internal service
Flux Gate is an HTTP/HTTPS reverse proxy for web services. It does not proxy arbitrary TCP ports or non-HTTP protocols such as SSH, MySQL, Redis, or raw socket services. Route-level Basic Auth works at the HTTP layer, so TCP port forwarding should be handled by a dedicated tunnel or TCP proxy instead.
npm installcp config.sample.json config.json{
"port": 8080,
"baseDomain": "your-domain.com",
"auth": {
"username": "admin",
"password_hash": ""
},
"routes": [
{
"subdomain": "demo",
"ip": "192.168.1.100",
"port": "3000",
"description": "Demo service",
"username": "",
"password_hash": "",
"no_password": false,
"disabled": false
}
]
}Field summary:
port: admin server portbaseDomain: your main domain managed by Cloudflareauth.username: login usernameauth.password_hash: SHA256 password hash; empty means first run usesadmin/adminroutes: list of subdomain forwarding rulesroutes[].username: optional route-specific username; empty means use the default admin usernameroutes[].password_hash: optional route-specific SHA256 password hash; empty means use the default admin passwordroutes[].no_password: whentrue, that sub-site is exposed without Basic Authroutes[].disabled: whentrue, that route is saved but unavailable
To generate a password hash:
node -e "console.log(require('crypto').createHash('sha256').update('your-password').digest('hex'))"cloudflared tunnel login
cloudflared tunnel create my-tunnel
cloudflared tunnel route dns my-tunnel your-domain.com
cloudflared tunnel route dns my-tunnel "*.your-domain.com"Terminal 1:
npm startTerminal 2:
cloudflared tunnel run my-tunnelpm2 start src/server.js --name flux-gate
pm2 start cloudflared --name cloudflare-tunnel -- tunnel run my-tunnel
pm2 save- Username:
admin - Password:
admin
Change it immediately after first deployment.
Flux Gate publishes internal services to the public internet.
Please avoid exposing:
- databases
- admin tools without extra protection
- file systems or private dashboards
- anything with sensitive data unless properly secured
Use strong passwords and only publish what you really need.
Check these first:
cloudflaredis running- wildcard DNS (
*.your-domain.com) is configured - the target IP and port are correct
- the target service is actually running
Open the admin panel, fill in subdomain / IP / port, and save it. You can also edit route-specific username/password, allow no password, or disable the route. Changes are written to config.json and apply immediately.
ISC
