When a firewall blocks the road from your users to your server, a relay on their side of it can carry the connection. The apps connect to the relay, and it passes everything on to your server without opening it.
How a relay works
Your users can reach your server in two ways: straight at its own address, or through a relay. The relay can be any machine on their side of the firewall that can still reach your server, for whatever reason: it may have a privilege, or a path where the usual restrictions don't apply, such as a data center network that the firewall lets through. Your users reach it like any local server, and it forwards one port on to your server.
The relay can't read the tunnel, which is encrypted from the app to your server. It sees which addresses connect to it and how much they send, and your server sees the relay's address in place of your users'.
A proxy in the relay's place
A proxy is another way to build the relay: the machine runs a SOCKS or HTTP proxy instead of forwarding a port, and the app reaches your server through it, as through any of its proxies. Both can run on the same machine. But a proxy has drawbacks that a relay doesn't:
The request of a SOCKS or plain HTTP proxy names your server's address in plain text, so anyone on the way to the proxy can read where your users connect, and block it.
The app sends the tunnel through a proxy over TCP only, whatever the Tunnel protocol setting, even when the proxy could carry UDP. A relay passes UDP on as well.
Each user has to add the proxy to their app, while a relay's address can travel in their keys.
A relay asks for nothing. Your users connect to it as they would to your server, so anyone on the way sees only the tunnel.
A relay on a satellite link
A relay whose own internet comes over a satellite link, such as Starlink, needs no way through the firewall: its traffic goes up to the satellite and down to your server, and never meets the firewall. Your users reach the relay over the local network.
Set up the relay
Choose a machine on your users' side of the firewall that can reach your server and has port 443 free. The relay's installer is for Linux with systemd, such as Ubuntu and Debian. A router can be the relay too, by forwarding the port in its own settings.
On that machine, run the relay's installer. Put your server's address in place of 203.0.113.10:
The relay starts at once, and again after every restart. It passes on TCP and UDP on port 443, only what is sent to the relay itself, so the machine's other traffic is left as it was. It works beside a firewall such as ufw, and beside Docker.
If your server uses another port, add -port and that port. The relay then takes it too.
To see the relay, turn it off or on again, or remove it:
sudo vhrelay status
sudo vhrelay disable
sudo vhrelay enable
sudo vhrelay uninstall
Give your users the relay's address
There are three ways, and you can use them side by side.
In the access keys
Your keys can carry the relay's address beside your server's own. Each app connects through whichever of them answers, so users who can reach your server directly still can.
On a standalone server, add the relay's address to PublicEndPoints, as Set your server's IP addresses shows, keep your server's own address there too, and restart the server.
Keys you have already given out get the relay's address the next time their app connects to your server. An app that can no longer reach your server needs a new key from you.
With a domain name
If your keys carry a domain name, point the name at the relay: put the relay's address in its DNS record. The apps look the name up and connect to the address it gives, so you can move to another relay later by changing the record, with no new keys.
Typed in by a user
A user can also enter the relay's address in the app, with no change to the keys. In the server list, they open the server's menu, choose Custom server address, turn on Use custom server address, and enter the relay's address and port. Only the users you tell use the relay.