Skip to content
项目

关于

🦊 Free system-wide VPN for Linux, macOS & Windows using Firefox's built-in VPN (IP Protection). SOCKS5/HTTP proxy, TUN routing, DNS over HTTPS, terminal UI.

系统与基础设施

这些数字如何统计

可以做什么

  • 🌍 Free VPN servers: US, Germany, Japan, Australia, Argentina, South Africa
  • ⚡ Fastest here: first in Locations, it connects to whichever location answers quickest on this network, and to the next if that one's blocked by then. New installs start on it; on the command line, --country fastest
  • 🚧 Blocked while you're on it: when this network starts blocking the location in use, Foxhole looks again and says so, with Switch to one that works (on Android, in its notification too); through Fastest here, it moves on by itself
  • 🧦 SOCKS5 and HTTP proxy on one port (127.0.0.1:1080) for any app

实测星标增长

24小时
0
7天
正在收集历史
15天
正在收集历史
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

foxhole-vpn 🦊 — Firefox's free VPN for your whole system

npm version npm downloads License: MIT Platforms

Use Firefox's built-in VPN (the free "IP Protection" proxy) outside the browser: a local SOCKS5 + HTTP proxy for any app, or whole-system VPN routing, on Linux, macOS, Windows and Android (phones and TVs). A desktop app, an Android app or a terminal app.

Foxhole desktop app: Fastest here, connecting the whole system, then Proxy only

Unofficial. Not affiliated with Mozilla. Routing all your system traffic through Firefox's VPN is probably outside Mozilla's intended use; your account and its monthly data cap are your responsibility.

Features

  • 🌍 Free VPN servers: US, Germany, Japan, Australia, Argentina, South Africa
  • 🚦 Which locations work here: Foxhole tries each location's server in the background, the way a connect does (a TLS handshake: no data counted), and Locations marks the ones this network blocks, with how quickly the others answer and how long ago it looked. Sorted the fastest here first, or free first (Firefox's way), or A–Z. A connect to a blocked one offers one that works, a click away (in the tray too, and in a notification when the window's behind); when none works here, it offers Relay. In the app, on Android and in the terminal (c checks again, f sorts, n takes what's offered)
  • 🚪 More ways in: Firefox VPN has more addresses than its list names, and a network that blocks a location's own may not block another that goes to the same place. Firefox's pick, first in Locations, is wherever Firefox VPN's network sends you: its nearest place to you (from Iran: the Netherlands, now and then Belgium), or, through a bridge, to Cloudflare's machine, so no country is promised; it's reached by any of some 200 addresses; the US has one more; and Hong Kong, which isn't on Firefox's list, is reached by one. Foxhole knocks on them as it does on the list's servers and connects by one that answers: on an Iranian network where Thailand's was the only one of the list's 34 servers to answer, Firefox's pick, the US and Hong Kong did too. On the command line, --country nearest
  • 🌉 A bridge of your own (experimental): a location the network still blocks can be reached through a free Cloudflare Worker on your own account, which passes Foxhole's encrypted connection on to Firefox VPN's server. Foxhole uses it only where a location doesn't answer by itself, and Locations says bridge on those; it also reaches Mozilla and Foxhole's updates where they're blocked, before the relay. See A bridge for blocked locations
  • ⚡ Fastest here: first in Locations, it connects to whichever location answers quickest on this network, and to the next if that one's blocked by then. New installs start on it; on the command line, --country fastest
  • 🚧 Blocked while you're on it: when this network starts blocking the location in use, Foxhole looks again and says so, with Switch to one that works (on Android, in its notification too); through Fastest here, it moves on by itself
  • 🧦 SOCKS5 and HTTP proxy on one port (127.0.0.1:1080) for any app
  • 🛡️ Whole-system mode (TUN) with DNS over HTTPS inside the tunnel and IPv6/QUIC leak protection
  • 📞 Calls through it: UDP to the ports the VPN takes (WebRTC's), in whole-system mode
  • ✂️ Split tunneling: pick the sites and apps that skip the VPN, or the only ones that use it (apps: on computers and on Android)
  • 🇮🇷 🇷🇺 Iranian or Russian sites direct, picked in one tap, and with Iran's Save data: other sites go direct too where they open, blocked ones through the VPN
  • 🔎 Blocked or sanctioned? Split tunneling's Check tries a site directly and through the VPN: Iran's filter (or Russia's, with Russia's sites picked), sanctions, or open (then it can skip the VPN). And when your country cuts the international internet off and keeps its own sites up, as Iran and Russia do, Foxhole says so
  • 📊 Data by site: which sites spend the VPN's monthly data, when it runs out at this rate, and one click to send a big one direct; hide the sites you'd rather not list, or turn the Usage monitor off, till Foxhole restarts or always (which forgets the month's list)
  • ✈️ Telegram in one tap: on a computer, the proxy card's button sets its Telegram; with sharing on, a QR code sets your phone's
  • 📱 Share with your phone on the same Wi-Fi
  • 📲 Foxhole on your phone: the desktop app gives your Android phone or TV the app itself over the Wi-Fi, with no VPN needed there to get it, then signs it in with your relay (Install)
  • 📺 Smart DNS for a TV or console: set its DNS to your computer, and YouTube and blocked or sanctioned sites open on it, with no app
  • 🧱 Shield: malware, ads and trackers blocked before they load, and at a switch social networks, porn, gambling, clickbait, other VPNs and crypto miners, with rules of your own; and YouTube's ads taken out in your browsers
  • 🧮 Look like a calculator (Android): for a phone that may be searched, Foxhole's icon and name become a calculator's that works as one, and your code, then =, opens Foxhole. Android's own Settings still list Foxhole, and while it's connected Android shows its VPN
  • 🔘 Quick Settings tile and a widget on Android: on or off without opening the app, and the month's data left on the home screen
  • 🗣️ In Persian too (فارسی), right to left: the desktop and phone apps, with the tray, the notification, the tile and the widget, by Settings → Language. In Russian too (Русский), by the same setting. The terminal UI and the CLI stay in English
  • 📣 News from the developer: a channel to join, a how-to on video, a change that needs a word. A post comes up once, with its own button, and all of them stay in Settings → News (in the terminal: e)
  • 🟣 Relay mode for networks that block Firefox VPN (e.g. Iran)

Install

Desktop app (no Node.js needed): download from the latest release.

  • Mac: Foxhole-<version>-arm64.dmg (Apple chip) or -x64.dmg (Intel), macOS 13+. First start: System Settings → Privacy & Security → Open Anyway.
  • Windows: the .exe. SmartScreen: More info → Run anyway.
  • Linux: the .deb on Ubuntu and Debian (preferred), the .AppImage on Fedora and any other: it needs nothing installed first.

It updates itself and lives in the tray / menu bar. It opens disconnected; connecting goes on to whole-system mode unless you last picked Proxy only. Settings → Start when you log in starts it there, connected to your last location (in whole-system mode only if that needs no password or prompt).

Updates (the Update button on computers and Android; u in the terminal UI) download through Firefox VPN while it's on, else directly. With it off they go directly first, then through Firefox VPN opened just for the download; your relay last. Each takes over when the one before can't get through or crawls (under 1 MB in 30 seconds), carrying on from where it stopped.

Android app, for phones and TVs (Android 9+): in the desktop app, Settings → Foxhole on your phone (or the tray menu), then scan its QR code with the phone's camera, on the same Wi-Fi. The computer gets the app the way updates come, so the phone needs no VPN to get it, and gives it over the Wi-Fi; Sign the phone in then sends it your sign-in, with your relay. An Android TV types the page's address into its Downloader app. Or download phone-and-TV-android-foxhole-<version>.apk from the release: Chrome warns first (Keep, then Download anyway), and Android asks to let it install apps. On Android, connecting always takes the whole phone or TV (Android's VPN, which it asks to allow the first time): there's no Proxy only. The proxy still runs beside it, for other devices on the Wi-Fi once Settings shares it.

Terminal app (Node.js 18.18+):

foxhole in the terminal: connecting the proxy, then whole-system mode

npm install -g foxhole-vpn && foxhole

Ubuntu 24.04: sudo apt install nodejs npm && sudo npm install -g foxhole-vpn. Ubuntu 22.04's Node is too old: sudo snap install node --classic first.

Before you start: sign in to the Firefox browser with a Mozilla account (Sync can stay off). foxhole reads that login to get the VPN token; if you're signed out, it opens Firefox's sign-in for you. Or sign in in Foxhole itself, in Accounts (the desktop app's window, or a in the terminal UI → Sign in to a Mozilla account): Mozilla's own page, in a window, 2FA too. The terminal opens it in the desktop app's window where that has run on the computer, else in a Firefox of its own (Firefox's own sign-in on a fresh profile, deleted after: your Firefox stays as it is, and nothing syncs); where there's neither, or no screen (a container, SSH), it says so. Mozilla turns away sign-ins typed into apps themselves (HTTP 406), and its page a browser driven from outside. On a first start the terminal asks which: e that window, f Firefox's sign-in (whose screen offers e too), or d to sign in from another device: the terminal shows a 6-character code (and a QR code where it fits), and a phone, computer or TV where Foxhole is signed in, on the same network, sends the sign-in from its Settings → Sign in a TV or phone, with its VPN relay where it has one. It takes no window and no Firefox, so it works in a container or over SSH too. The terminal UI adds accounts the same way: a → Sign in from another device.

Usage

foxhole                     # interactive TUI
foxhole proxy --country US  # just the proxy
foxhole global --country US # route the whole system
foxhole countries           # list countries
foxhole usage               # data left this month
foxhole doctor              # check login, server list, entitlement
foxhole restore             # undo whole-system routing if foxhole was killed
foxhole bridge              # your bridge, for what this network blocks: new | update | <link> | off

In the TUI: pick a location and press Enter to connect (it starts disconnected; ⚡ Fastest here, the default, goes to the quickest that answers on this network). c checks again which locations work on this network, f sorts them another way (the fastest here first, the default; free first; or A–Z), and n takes what the status line offers: a location that works here when the one picked, or in use, is blocked; or the relay. g ticks or unticks Global TUN: ticked, the default, connecting goes on to whole-system mode (asks for your password in-app), and your choice is kept for next time. t split tunneling (i Iranian or r Russian sites direct, the same key again for neither; s save data, with Iran's; ? checks a site as you type it), m data by site (h hides a site from it, a shows the hidden, c stops counting, till Foxhole restarts or always, or counts again), b Shield, a accounts, l logs, s settings (Use in Telegram shows its QR code), e Foxhole's news: the post the line under the buttons tells of, else all of them. On Windows, whole-system mode asks for administrator rights in Windows' own prompt, once: allow Windows PowerShell. With it Foxhole sets up its network helper, a scheduled task running a PowerShell script in C:\Program Files\Foxhole Helper, and Windows doesn't ask again. It only runs the commands whole-system mode needs, and only you may start it. To remove it, in an administrator PowerShell: Get-ScheduledTask foxhole-net-* | Unregister-ScheduledTask -Confirm:$false; Remove-Item -Recurse "$env:ProgramFiles\Foxhole Helper".

On Linux and macOS the password is asked once: with it Foxhole sets up a small network helper, as other VPN apps do, and whole-system mode needs no password after that, in the app, the TUI and foxhole global alike. The helper is a root-owned script (net, in /usr/local/libexec/foxhole on Linux, /Library/PrivilegedHelperTools/foxhole on macOS) and one sudoers rule (/etc/sudoers.d/foxhole-<uid>) for your user, no background service. It only runs the exact commands whole-system mode needs, so a program of yours could use it to send this computer's traffic through a proxy on this computer, but not to get a root shell. To remove it, run sudo <that folder>/net uninstall.

Point an app at the proxy:

export ALL_PROXY=socks5://127.0.0.1:1080
export HTTPS_PROXY=http://127.0.0.1:1080 HTTP_PROXY=http://127.0.0.1:1080

Whole-system mode needs tun2socks; foxhole downloads it for you. If GitHub is blocked, put the binary on your PATH.

Shield

Shield (its card in the app, b in the TUI) blocks the sites on the lists you turn on: Malware and Ads + trackers from the start, and Social networks, Porn, Gambling, Clickbait, Other VPNs and Crypto miners at a switch. A blocked site gets no address (DNS answers that there's no such site) and no connection: in every app in whole-system mode, in apps using the proxy in Proxy only mode, in relay mode, and on TVs and consoles using Smart DNS (on an iPhone, apps using the proxy). Manage custom rules blocks a site no list has, or lets through one a list has: ads.example.com with its subdomains, *.example.com only its subdomains, an address or a range (10.0.0.0/8). Your rules come first, and Foxhole's own sites are never blocked.

The lists are HaGeZi's (GPL-3.0), with StevenBlack's fake news list (MIT) in Clickbait and NoCoin (MIT) as Crypto. Foxhole doesn't ship them: it gets a list when you turn it on (through the VPN when connected), and a newer one each day (Malware) or week (the others). Malware and Ads take about 3 MB.

YouTube ads (computers, Chrome on Android; not TVs): YouTube sends its ads from the servers its videos come from, so no list can block them. With this switch on, Foxhole opens YouTube's pages (www.youtube.com, m.youtube.com, music.youtube.com) here, with a certificate from its own authority, and takes the ads out before your browser sees them, as uBlock Origin does in Firefox: the player gets no ads to play, and the ad slots in search and the feed are hidden. Its certificate must be trusted, which the switch asks for once (relay mode's: made on your device and never sent anywhere). YouTube's own apps don't trust it, so they get YouTube as it is, ads and all: Foxhole notices the first refusal and lets them be. When YouTube changes its ads, hot.json (Foxhole's signed fixes) can follow without a release.

Where Firefox VPN is blocked (e.g. Iran)

Set up a relay: a free Google Apps Script on your own account. In the desktop app it's Settings → Bridge & Relay → Manage, then the Google Relay card; in the TUI, s, turn Relay on, then Set up step by step under it. It shows each click with a screenshot. The relay:

  • reaches vpn.mozilla.org for foxhole when it's blocked, or refuses your country ("VPN not available in this region"): only small control calls, your traffic still goes through Firefox VPN. Once connected, even those go through the VPN, so the relay only gets the first pass of each connect;
  • reaches the server list when it doesn't connect. Mozilla's account server (api.accounts.firefox.com: the VPN's token, and sign-ins) has turned the relay away since 2026-11 (HTTP 406), so where it's blocked, foxhole makes each next token through Firefox VPN while it's connected, and a TV or phone signed in from another device gets its first token with the sign-in. Without a relay, foxhole says which one is blocked and offers the setup; and
  • can carry your browsing itself: pick Relay in Locations, after Fastest here and Firefox's pick. In the desktop app its row has a dropdown for the way it goes: Cloudflare, through your bridge's Worker (the default where you have both), or Google, through this script. One you haven't set up is dimmed; picking it opens Manage (below) with its card lit for a few seconds.

A bridge, where you have one, is tried before the relay for all of these but browsing. The relay has a switch of its own in Settings → Bridge & Relay (in the desktop app, in its Manage window, over your relays): off, the relay is kept but not used, and isn't in Locations. It's on for a relay set up before there was a switch, and turns on as one is set up or comes from another device.

In the desktop app, Settings → Bridge & Relay shows both in short (how many of each, and this device's requests through them today), with Manage and Send to a TV or phone. Manage has a card for each way, Cloudflare Bridge (recommended) and Google Relay, each opening its setup step by step, and under them your bridges and relays, a table each: a row for each, with this device's requests through it today, to change or remove (with Undo), saved as you type, and one more pasted in its last row. You can keep several of each: when one's requests for the day are spent, Foxhole goes on with the next. Each bridge needs its own Cloudflare account, as an account's Workers share its 100,000 requests a day: two on one account are refused on their rows, as you type them.

On an Android phone or TV, make the bridge and relay on a computer (Cloudflare's and Apps Script's setups need one), then bring them over on the same Wi-Fi, both at once, with the relay's switch as it is there: on the phone or TV, Settings → Bridge & Relay → Get them from your computer shows a QR code and a 6-character code; on the computer, or a phone that has them, Settings → Bridge & Relay → Send to a TV or phone scans the QR code or takes the code. A TV signed in from a phone or computer (Settings → Sign in a TV or phone) gets the bridge and relay with the sign-in (Bridge & Relay too leaves them out), and so does a phone or computer that picks Sign in from another device where it asks to sign in; in the terminal UI, Settings → Sign in a TV or phone takes the code and sends them too (tab leaves them out), and a TV or phone waiting for them alone gets just them. Every device you send the bridge to shares its Worker's 100,000 free requests a day; the dialogs say so. A device with an older Foxhole takes the relay but not the bridge: the sender says so, and to update Foxhole there. On a TV the relay only reaches Mozilla: a TV's apps don't trust relay mode's certificate, so it has no Relay location.

Split tunneling → Your country's sites direct sends them around the VPN: pick Iran or Russia (or Off). Iran's go by name (.ir, and 57,000 more from iran-hosted-domains) and by address (Iran's ranges), refreshed weekly through the VPN. Banks and payment pages work, and that traffic costs Iran's cheaper rate instead of the VPN's data. Russia's go by name (.ru, .su, .рф and Russia's other domains, and about 870 more from v2fly's category-ru) and by address (Russia's ranges), refreshed weekly the same way (the names from MetaCubeX's build of v2fly's list): Gosuslugi, banks and the many Russian sites that turn foreign addresses away work. Save data, with Iran's, goes further: every other site is tried directly first, and one that's blocked (the filter's DNS answer, a reset, silence) goes through the VPN and is remembered for 3 days. Your provider then sees which sites you visit. Sites that refuse Iranian addresses (sanctioned) always use the VPN. On a Mac, Save data works in Proxy only mode.

Settings → Smart DNS for a TV or console (desktop app and TUI) makes your computer the DNS server of the home's other devices: a smart TV, a PlayStation or Xbox, an iPhone. On the device, set DNS by hand to the address Foxhole shows. While Foxhole is connected, a site Iran blocks (the network's DNS answers with the filter's address, or stops a test handshake with it) or one that refuses Iran (sanctioned) is answered with your computer's address: the device's connection comes to Foxhole on port 443 or 80, and goes on through the VPN to the site its TLS SNI or HTTP Host names. Every other site gets the network's own answer and goes direct. Only the web and WhatsApp's messages go through: games' and calls' traffic doesn't. An iPhone's iCloud Private Relay and a browser's secure DNS skip it. On an iPhone, every app except Safari needs its permission on, in Settings → Privacy & Security → Local Network, to reach your computer. When the computer is off, set the device's DNS back to automatic. On a Mac, the device's Telegram, which doesn't use DNS, goes through too once the device has your computer as its router: Settings says how (and asks your password once, for the network helper). Linux keeps ports 53, 80 and 443 for root: sudo sysctl -w net.ipv4.ip_unprivileged_port_start=53 lets Foxhole have them (add it to /etc/sysctl.d/ to keep it).

Fixes without an update: when the filtering changes, foxhole picks up the workaround (other addresses for Mozilla's servers and for the VPN's locations, more Google sites for relay mode to reach directly) and a short notice from hot.json, which it checks against the developer's signing key. It fetches the file at start and every 6 hours from GitHub, jsDelivr and githack, through the VPN when connected and through your relay when nothing else answers. A file that doesn't verify, or is older than the one it has, is ignored.

News come the same way: posts written in news/ (a title, a description in Markdown with pictures and YouTube or Aparat videos, a button that opens a site), signed with the same key and fetched from the same mirrors. Each comes up once on a device, till it's closed or its button is pressed, and they all stay in Settings → News. The desktop app plays a post's video in place, through the VPN while it's connected; Android opens it in the video's own app or the browser; the terminal shows its address.

Relay mode is web-only, slower, has no country choice and doesn't hide your IP (Google forwards it). Sites with bot checks (Cloudflare, Reddit, ChatGPT) refuse it. It needs foxhole's certificate trusted; foxhole asks after your first connect.

Through Cloudflare it's quicker and carries more: every app's connections on ports 80 and 443 go through your Worker as they are, each site's own encryption end to end, and sites see Cloudflare's address, not yours. A site on Cloudflare, which a Worker can't open that way, is opened by foxhole (with its certificate, as above) and each request fetched by the Worker, its WebSockets too. Each connection, and each request fetched, is one of the Worker's 100,000 a day. The rest (other ports, UDP) goes direct, as with the script. It needs the Worker's code from foxhole 2.0 or later (for an older one, foxhole bridge update, or Copy its code on its row in Manage). Command-line tools: eval "$(foxhole env)". The script is in assets/relay/Code.gs.

A bridge for blocked locations (experimental)

Some networks drop the addresses of most of Firefox VPN's locations, though the VPN itself works: one in Iran leaves Thailand, and the other ways in. A bridge carries Foxhole's connection to the rest. It's a small Cloudflare Worker on your own free Cloudflare account, at an address (*.workers.dev) such a network lets through.

foxhole bridge new > worker.js   # the Worker's code, with a key made for it; the steps are printed
# dash.cloudflare.com → Workers & Pages → Create → Start with Hello World → Deploy → Edit code:
# paste worker.js over what's there → Deploy
foxhole bridge https://<the worker's name>.<yours>.workers.dev/<its key>   # checked from here, then kept

In the desktop app it's Settings → Bridge & Relay → Manage, then the Cloudflare Bridge card: a few minutes, each step with a picture of Cloudflare's page; it copies the Worker's code with its key, and at the end takes the Worker's address alone, checks it and keeps it (one on the Cloudflare account of a bridge you have is refused as you type it). In the terminal UI it's the Set up row under s, the same steps; without them, Worker's code there, make the Worker as above, then type its address. Or paste a bridge's link in the last row of Manage's bridges. On Android, Settings has the same field for a bridge made on a computer: its link is the Worker's address, then / and the KEY in its code.

  • Only where it's needed: Foxhole looks at each location's own servers first, and tries the bridge for the ones that don't answer. Locations says bridge on those; a location that works by itself never goes through it.
  • Mozilla and updates too: where vpn.mozilla.org, Mozilla's account server or GitHub (Foxhole's updates, its news and fixes) don't answer directly, Foxhole goes to them through the bridge, before the relay. Mozilla took a sign-in, a token and the VPN's pass through a Worker in a test from Iran (2026-11-29).
  • A blind pipe: Foxhole's TLS runs inside it, each site's certificate checked as ever, so Cloudflare sees which of these you reach and how much you send, not what. Foxhole sends it only Firefox VPN's servers, Mozilla's three hosts and GitHub's four (port 443).
  • Keep the link to yourself: the Worker opens Firefox VPN's servers and any site on ports 80 and 443 for whoever has the key in its link, and fetches a page itself for a site on Cloudflare, which a Worker can't open as a connection (its /fetch: that request it sees whole, as the relay's script does). Anyone with the link can browse through your Worker, on your account and its daily requests.
  • 100,000 requests a day, on Cloudflare's free plan: each connection an app opens through a bridged location is one. When they're spent, Foxhole goes on with your next bridge, if you have one; else those locations stop answering until midnight UTC. Every device you send the bridge to (Bridge & Relay too) uses the same Worker, so they all share those 100,000 requests.
  • Cloudflare's terms: its Self-Serve Subscription Agreement (2.2.1 (j)) doesn't allow using its services "to provide a virtual private network or other similar proxy services", and it can suspend an account that does. The account is yours, and so is the call.
  • Whole-system mode: the bridge's address goes around the tunnel, as a server's does. It's one of Cloudflare's shared addresses, though, so other sites that live on that same address are then reached directly, not through the VPN. The proxy by itself (Global TUN unticked) has no such gap.
  • An older Worker: Foxhole asks the bridge's version as it starts, and says so when its code is older (one that carries Firefox VPN's servers alone). foxhole bridge update, or Copy its code on its row in Manage, gives the new code with the bridge's own key: pasted over the old code at Cloudflare, the link stays the same.
  • FOXHOLE_BRIDGE=<link> uses one without keeping it; foxhole bridge off forgets the one kept. The Worker's code is assets/bridge/worker.js.

In a sandbox (Docker)

Proxy only, with nothing installed but Docker (sign in to Firefox on your computer first):

docker build -t foxhole-sandbox -f sandbox/Dockerfile https://github.com/Diercohen/foxhole-vpn.git
docker run -it --rm --init -p 127.0.0.1:1080:1080 \
  -v "<path to your Firefox profile>/signedInUser.json:/root/.mozilla/firefox/sandbox.default/signedInUser.json:ro" \
  -v foxhole-config:/root/.config/foxhole-vpn \
  foxhole-sandbox proxy --host 0.0.0.0

For whole-system mode on Linux, add --network host --cap-add NET_ADMIN --device /dev/net/tun -v /run/dbus/system_bus_socket:/run/dbus/system_bus_socket and drop -p … proxy --host 0.0.0.0 (that D-Bus socket gives the container near-root on your computer). In Iran, add --build-arg BASE=registry.docker.ir/library/node:22-bookworm-slim to the build.

Limits

  • UDP to some ports only: the VPN carries UDP to ports 80, 443, 3478, 8080, 8443 and 49152 and up, so calls (WhatsApp, Discord, Teams and other WebRTC apps) work in whole-system mode; DNS, NTP and most games' ports don't. QUIC stays on TCP, which is faster through it.
  • TCP to web ports only: the VPN takes TCP to ports 80, 443, 8080 and 8443 (and 3478), and refuses the rest (SSH :22, mail). Git over SSH to GitHub still works, via ssh.github.com:443; and so do a phone's notifications in whole-system mode (Google's push messaging, ports 5228 to 5230), via the same servers' port 443.
  • A silent connection is closed after 4.5 minutes: the VPN's servers close one that has carried nothing for 270 seconds. Apps connect again by themselves; Android's notifications too, some seconds late, or minutes while the phone sleeps. On Android, Split tunneling's Notifications around the VPN sends Google's push messaging directly where it connects that way (Google then sees your real IP), and notifications come on time; a split-tunneling rule that sends a site direct does the same for that site.
  • Whole-system mode refuses to start next to another full-tunnel VPN, and says which (Windscribe on tun0, say) before any password: its routes would take all the traffic, and its kill switch what goes around it. The proxy works alongside it. foxhole global --force goes ahead anyway.
  • Without systemd-resolved (Linux), DNS falls back to your own resolvers, which leaks; foxhole says so.

How it works

foxhole reads your Firefox Account login from your Firefox profile, exchanges it for a short-lived proxy pass from Mozilla's Guardian API (see AUTH.md), and runs a local SOCKS5 + HTTP proxy that tunnels through Firefox VPN's Fastly servers. Whole-system mode adds a TUN device (tun2socks) and routes everything into it. It says connected only once a page opens through the server it picked (ipify's, or Cloudflare's), so a network that blocks Firefox VPN's servers says so rather than looking connected; whole-system mode the internet doesn't open through goes back off at once, the proxy staying on if the VPN works, and a sign-in that's ended (signed out elsewhere) disconnects and asks to sign in again.

Building

npm install && npm run build   # the CLI: node dist/cli.js
cd gui && npm install && npm start   # the desktop app (Node 22.12+); npm run dist for installers
cd mobile && npm run build   # the Android app (JDK 17, Android SDK + NDK 27.1)

The Android app, for phones and TVs, is native: Kotlin screens drawn by Jetpack Compose (mobile/android/app/src/main/java/…/ui), over the desktop app's core on Node for Android (nodejs-mobile), with hev-socks5-tunnel for whole-system mode. Its words are the desktop window's translations. Its APKs, one per ABI and a universal one, land in mobile/android/app/build/outputs/apk/release, shrunk by R8 and signed with the keystore at FOXHOLE_KEYSTORE (FOXHOLE_KEYSTORE_PASSWORD, FOXHOLE_KEY_ALIAS), or else the debug key.

The Persian is gui/renderer/fa.js and the Russian gui/renderer/ru.js, by the English. A window text is written t`…` (the core's messages as they are); node gui/i18n.test.mjs --missing [ru] lists the ones with no translation yet, and the GUI's tests fail on them.

Release: push a tag (git tag v2.0.0 && git push origin v2.0.0); GitHub builds the apps into a draft release.

License

MIT © Dier Cohen. The Iranian sites list in assets/lists is bootmortis/iran-hosted-domains' (MIT, its license), and the Russian one v2fly/domain-list-community's (MIT, its license); both countries' address ranges are ipverse/country-ip-blocks' (CC0).

探索相关项目

加载中…