Exits
An exit is where your clients’ traffic leaves for the internet. The panel calls the page Outbounds. Without an exit, clients reach the internet straight from this server and websites see its address. With one, websites see the exit’s address instead: another country, an address that is not blocked, or Cloudflare’s. Press Add outbound to choose a kind.
| Kind | What it is |
|---|---|
| Exit server | A second server running AFTAB’s exit program. Websites see its address. |
| Cloudflare WARP | A free exit from Cloudflare, with no second server. Sites see a Cloudflare address, so there are fewer captchas, and services that block data center addresses, such as AI tools and streaming, work. |
| Import .conf | Any WireGuard config, for example from a VPN provider (Mullvad, Proton, NordLynx) or another server. This server connects to it like a client. |
| SOCKS5 proxy | Any SOCKS5 proxy: your own, a provider’s, or Tor’s. |
| Tor | The Tor network. Slow, and it carries no UDP. |
| Psiphon | Psiphon on this server. Slow per connection, TCP only, one session shared by every client on that exit. |
Send traffic through an exit
Section titled “Send traffic through an exit”- For a whole inbound, set its Route: Inbounds → Edit inbound → Route. Every client of the inbound leaves through the exit.
- For one client, choose an Exit in the client’s form. A plan can carry an exit too, so clients given that plan leave through it.
- For some sites only, use a routing rule, see Routing and split tunnel.
A routing rule that matches is checked first, then a client’s own exit, then the inbound’s Route.
When an exit is down
Section titled “When an exit is down”If an exit is down, the traffic sent through it stops. The panel records the exit going down and coming back, and the Bridges and Iran Telegram alerts include it, whether or not a backup takes the traffic. It never falls back to this server’s own address: this is the kill switch. Traffic that was meant to leave through the exit never leaves with your server’s address. To keep clients online, add backup exits. In the inbound’s form, under Route, the list Backup exits takes up to 4 backup exits: press Add a backup exit.
When the exit above fails its health check, 2 checks in a row, 20 seconds apart, traffic moves to the first working backup, and back when the first one recovers. Which exit chooses In this order or The fastest: the working exit with the lowest delay and packet loss, changed only when another is clearly faster and at most every 10 minutes. Open connections end when it changes. If every exit in the list is down, the kill switch holds the traffic.
Add an exit server
Section titled “Add an exit server”- Press Add outbound and choose Exit server. Give it a name, the Exit server address (the public IP or hostname of that server) and a UDP port. The default is port 51821.
- The panel shows the Install command. Run it as root on the exit server. It needs the panel on HTTPS, and if the panel is not, the window says how to turn it on. The command carries a secret that works once and lasts 24 hours; the row’s menu gives a new one under Install command.
- The command installs
wireguard-tools,nftables,iproute2andprocpsif they are missing, tunes the kernel for forwarding, joins the panel and sets up the WireGuard tunnel and NAT as the panel tells it. Open the tunnel’s UDP port in that server’s cloud firewall. - When the row says Connected, press Test. A good answer reads “Tunnel OK” with the delay and the exit IP.
A changed port or MTU is applied by the exit server itself within a minute. The switch Leave through Cloudflare WARP in the edit form sends the exit server’s traffic out through WARP from there: sites see a Cloudflare address, and while WARP is down there, the traffic stops.
Delete asks the exit server to take down the tunnel and remove the AFTAB program, then the exit leaves the list. If that server is gone for good, Remove now takes it out of the panel without waiting. By hand, on the exit server, run sudo /usr/local/lib/aftab-exit/aftab-exit uninstall --role exit; the Uninstall command in the install window shows it too. Revoke is for a server that was lost or seized: its token and tunnel keys stop working at once, and the exit carries no traffic until you run the new install command.
Exit servers store the panel’s signing key and list of addresses (node_addresses), so when you move the panel to another server they reconnect by themselves once HTTPS is up there: see Moving to a new server.
Cloudflare WARP
Section titled “Cloudflare WARP”- Press Add outbound, choose Cloudflare WARP and press Register with Cloudflare. This server registers a free WARP account and connects with kernel WireGuard. A WARP+ license key is optional, and a panel has only one WARP exit.
- Choose which traffic uses it: Inbounds → Edit inbound → Route for a whole inbound, or a routing rule such as the AI via WARP preset for some sites.
- If Test says WARP is not passing traffic, Cloudflare did not answer. Find a working endpoint tries Cloudflare’s WARP addresses and ports and switches to the fastest that answers; WARP traffic pauses for up to a minute meanwhile. Check that Send device ID is on, because many WARP servers ignore connections without it. New WARP IP, under Account, registers a new device with a different exit IP. Cloudflare refuses WARP from some hosting address ranges. Then use an exit server, or run WARP on the exit server.
A WireGuard .conf, SOCKS5, Tor or Psiphon
Section titled “A WireGuard .conf, SOCKS5, Tor or Psiphon”- Import .conf: paste the file or choose it. Only its IPv4 address is used, DNS and AllowedIPs are ignored, and an AmneziaWG config is refused. If Test finds no traffic, check that the config is still valid at its provider.
- SOCKS5 proxy: give the Proxy address, the Port (TCP), which is port 1080 by default, and a user name and password if the proxy has them. A program on this server that offers a local SOCKS5 port works too: use
127.0.0.1and its port. For Psiphon itself, prefer Add outbound → Psiphon. The tunnel is made byhev-socks5-tunnelon this server, and UDP works when the proxy relays it. Each connection is slower than on a WireGuard exit. - Tor: the panel makes the exit and installs and starts Tor on this server, showing the log. It connects within a minute. Each connection is slower than on a WireGuard exit. Many sites challenge Tor addresses, so use it for one inbound, some clients or some rules, not for everyone. A panel has only one Tor exit.
- Psiphon: the panel makes the exit and starts Psiphon’s tunnel-core on this server (port 9051), showing the log until the tunnel is up. TCP only; every client on that exit shares one session, and Psiphon sees this server’s address. A panel has only one Psiphon exit. Official tunnel-core builds are linux amd64 only for now; other CPUs are refused. Prefer it for some sites or one inbound, not for everyone.
What can go wrong
Section titled “What can go wrong”- Waiting for exit node, on the exit’s row: the install command was not run, or the UDP port is closed in the exit server’s firewall.
- Test says “No reply through the tunnel”. The exit program is not installed or the UDP port is closed. For a proxy, check its address, port and sign-in. For Tor or Psiphon, wait until the install log says the tunnel is up.
- Clients behind an exit lose their connection. The exit is down and the kill switch is holding their traffic. Fix the exit, or add backup exits, see Inbounds.
- No install command. Exit servers join only a panel on HTTPS, see HTTPS.