HF Tunnel app
The free HF Tunnel app shares websites running on your computer at public https links, with no account: a window and the hf-tunnel command.
HF Tunnel is a free desktop app for Windows, macOS and Linux that gives websites running on your computer a public
address such as https://shop.hostfog.io. It is HF Local's tunnel feature for any local
web server (Apache and PHP, Node.js, a JavaScript dev server): the same links, the same limits and the same messages,
with a local address in place of an HF Local site. It needs no account.
Download it from the website's Software page.
Share a website from the window
- Open HF Tunnel. The first time, read the notice and click I understand.
- Click Share an address.
- In Local address, type where your website runs, or click one of the ports under it: 80, 8080,
3000, 5173 or 8000 (
http://localhost:<port>). - If your local server uses virtual hosts, type the site's name in Host header (optional), for example
mysite.test. The local server then sees that name instead oflocalhost. - Check the Link: the first part of the address, made from the Host header (or chosen at random). You can change
it: lowercase letters, numbers and
-, up to 32 characters. The dialog says whether the name is already yours (You already have this link) or will be made new, and how many of your links are used. - Click Share.
The address shows Connecting…, then Live link and its link with Copy link. Its buttons:
| Button | What it does |
|---|---|
| Open | opens the link in your browser |
| QR code | shows the link as a QR code to scan with a phone |
| Requests | every request that came through the link: time, method, path, status and duration (the number counts them) |
| Stop sharing | ends the link; closing HF Tunnel ends every link too |
| Share | shares an address again, at the same link |
| Remove | takes an address that isn't shared off the list |
| Field | What it does |
|---|---|
| Local address | a port (80) or an address: http://localhost:8080, https://localhost:4443, http://localhost/shop (a folder becomes the link's root) |
| Host header (optional) | the name sent to your local server; empty = the address's own host |
| Link | the link's name: https://<link>.hostfog.io |
Several addresses can be shared at the same time, each at its own link. The card at the top shows the HF Tunnel service as HF Local's Tunnel page does: Ready · free, no account, Links on this computer (how many this computer has, and how many it may have) and Live now. Click Refresh to check again.
Share a website from a terminal
The same program is the hf-tunnel command (the Windows setup and the Linux packages put it on your path). Its
options are those of HF Local's hostfog share:
hf-tunnel 80
hf-tunnel http://localhost:8080 --host mysite.test --name shop
hf-tunnel 3000 --server myserver --name demo
hf-tunnel --help
hf-tunnel --version
| Option | What it does |
|---|---|
--host NAME |
the Host header sent to your local server |
--name LINK |
the link's name; without it, the one this address had last time (or a new one) |
--server NAME |
makes the link on one of your own HF Panel servers instead of the free links |
It prints the link, a QR code of it and one line per request. Ctrl+C stops it. On macOS the command is
/Applications/HF Tunnel.app/Contents/MacOS/hf-tunnel.
Your own servers
Like HF Local, HF Tunnel can make links on your own HF Panel server (with HF Tunnel switched on there), using an API token made in its panel (Password & security › API tokens, a Read & change token):
hf-tunnel servers add https://cp.example.com:8443 hf_… --name myserver
hf-tunnel servers
hf-tunnel servers remove myserver
Administrator and reseller tokens also need --account NAME (the hosting account whose links are used). A server
with a self-signed certificate shows its fingerprint and asks before it is trusted.
Links
- Each address keeps its link: sharing it again uses the same
https://<link>.hostfog.io. Stop sharing only disconnects it; the link stays yours. - Your computer gets its own private key the first time; the links belong to that key alone. No account, e-mail or token is needed.
- When the connection drops, the address shows Reconnecting… and HF Tunnel connects again by itself, waiting a little longer each time (up to a minute).
Safety
Warning: anyone with the link can open your local website while it is shared. Share it only with people you trust, and stop it when you are done.
- Nothing on your computer listens for the internet. HF Tunnel connects out to the tunnel server on port 7000 over an encrypted connection, and the server answers visitors over HTTPS with its own certificate.
- Only addresses on your computer or your local network can be shared, never a site elsewhere on the internet.
- The usual database tool addresses (
/phpmyadmin,/pma,/adminer),server-statusand the dashboard pages of local server bundles are refused through the link (visitors get Not available through HF Tunnel), so a database tool without a password is never reachable from the internet. HF Local's shared sites get the same. - HF Tunnel adds the
X-HostFog-Tunnelheader to every request it passes on, so your site can tell tunnel visitors apart.
Limits
Free links have the limits of HF Local's free links: a few links per computer, and links that aren't used are removed after a while. See Limits.
Note: if HF Tunnel says free links are switched off or the service can't be reached, check your internet connection and that your network allows outgoing connections to port 7000.