vpnhood/VpnHood
关于
一款开源 VPN,从引擎到应用和服务器都使用基于 .NET 的 C# 编写。它能够抵抗深度数据包检测:流量看起来与普通浏览相似,从而提升隐私性。
系统与基础设施实测星标增长
- 24小时
- +2
- 7天
- +11
- 15天
- +46
- 1个月
- +79
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
VpnHood!
An open-source VPN, from the engine to the apps and the server, written in C# on .NET. It resists deep packet inspection: it looks like ordinary browsing, for more privacy.
Website · Developer site · Features · Get started · Inside the repository · Changelog
Get VpnHood! CLIENT
For Android and Android TV, iPhone, iPad and Apple TV, Windows and Linux. All downloads, the APK from GitHub and IzzyOnDroid included.
How it fits together
Each layer is a set of NuGet packages that builds only on the layers under it, through contracts. Take only the parts you need, or replace any of them: your own look, your own host, your own ads and billing, another VPN engine under the same app, or your own access manager behind the server. Net knows nothing of a VPN, so any .NET app can use it.
VpnHood Client Architecture, on the developer site, goes through each layer and the contracts between them.
Features
In the apps
- Cloak Mode: VPN traffic looks like ordinary web traffic, so a network can hardly tell you use a VPN.
- Protocols: UDP, TCP and QUIC, to suit the network you are on, over IPv4 and IPv6.
- Smart Proxies: paste a proxy list, and the app tests, rates and rotates the proxies it reaches the server through.
- Split tunneling: by country, domain, IP address or local network, and by app on Android. Domains are found in both web and QUIC traffic, and a change applies without reconnecting.
- No DNS leaks: pick the DNS servers the tunnel uses; DNS stays in the tunnel even for traffic you split out of it, and IPv6 that the server cannot carry is blocked, not leaked.
- A Kill Switch that holds: on Windows and Linux the block stays through a crash of the app and a restart of the computer, and Lockdown keeps it after you disconnect. Android uses its own system setting.
- Always On: on Windows and Linux the VPN connects at boot, before anyone signs in.
- Reconnects by itself: after a network change, or when your server moves to a new address.
- Smooth under load: a big upload does not stall your browsing, and games that send large packets work.
- Command line: on Windows and Linux, connect, follow the status as JSON, and manage profiles and locations, on a machine with no desktop too.
- Diagnose: checks the network, DNS and the server to tell which one is at fault, and sends a report if you choose.
- Updates itself: the builds from GitHub too, on Windows, Linux and Android.
- On your TV: Apple TV and Android TV, set up from your phone.
- For everyone: 13 languages, and screen readers.
In the server
- One command: installs it on Linux (x64 or ARM64), Windows or Docker, and keeps it up to date.
- Standalone or managed: a server keeps its access keys in files, or asks an access manager of your own over HTTP.
- Keeps its machine patched: with
-osupdate, the operating system installs its security fixes every night and restarts when a fix needs it, each server at a time of its own, so the servers of a farm seldom restart together. - Steady sessions: connected devices stay connected through a restart of the server or its machine.
- Looks like a web server: to anyone without an access key, it answers as an ordinary web server would, and the name on its certificate follows no pattern that a network could match.
- No domain needed: an access key carries the fingerprint of the server's own certificate.
- Hard to block: separate addresses for connecting and for going out, reverse proxies such as Cloudflare, and settings for a censored network.
- Guards against abuse: blocks the mail port, limits each user's DNS and new connections, keeps users from reaching each other, and refuses the server's own and local addresses.
- Access keys with limits: the number of devices, the traffic, the speed and an expiry date, from the command line.
- No logs of your users: it does not log your users' IP addresses or the places they visit, and it anonymizes the rest of its logs.
- Tunes its machine: on Linux it sizes the connection table for a busy server, and can turn on BBR and add a swap file.
- Recovers on its own: it restarts its network adapter after a network change, and cleans up after a crash.
For developers
- All C#: everything in this repository is C# on .NET 11, open source under the LGPL 2.1, and audited.
- Your own VPN app: VpnHood.App.Template builds a branded app from the NuGet packages alone, with your own name, icons and servers, on every platform.
- Modular: use any layer on its own, or replace any part of it, as How it fits together shows.
- One codebase, every platform: Android, iOS, tvOS, Windows and Linux, with an Avalonia UI.
- Networking without the VPN: a user-space TCP stack, QUIC on Android and iOS, HTTP/3 without ASP.NET Core, the TUN and WinDivert adapters, and IP locations offline or online, for any .NET app.
- A server in your own code: run a VPN server from your app, with its access keys kept in files.
- Built for your own business: ad networks (AdMob, InMobi, Chartboost) and store billing (Google Play and the App
Store) plug in as providers, and a fork replaces only
src/apps/. - Examples that work: the code in the developer guides is taken from tests, and checked before each package release.
All features are on the website.
Get started
Run your own VPN
| Linux | Windows |
Install VpnHood! SERVER with one command on Linux, Windows or Docker, then add its access key to VpnHood! CLIENT, on Android and Android TV, iPhone, iPad and Apple TV, Windows or Linux.
Build your own app
Start with Build your VPN app on the developer site, or with VpnHood.App.Template, which builds a branded app from the NuGet packages alone.
Build from source
You need the .NET 11 SDK. Clone the repo with its submodules, which hold the apps' images and words, then build a head, such as the Windows app or the server:
git clone --recurse-submodules https://github.com/vpnhood/VpnHood.git
cd VpnHood
dotnet build src/apps/Client/Client.Windows.Web
dotnet build src/apps/Server
Inside this repository
| Folder | What it holds |
|---|---|
src/libs/Net |
networking with no VPN in it: packets, a user-space TCP stack, QUIC, the TUN and WinDivert adapters, IP locations |
src/libs/Core |
the VPN engine: the tunnel, the client, the server, split tunneling and proxies |
src/libs/AppLogic |
the app around the engine: its API, the app on each platform, the store and ad providers |
src/libs/AppHosting |
the hosts that run a UI on each platform: a window, a page in a browser, the desktop's service |
src/libs/AppUi |
the user interface: the Avalonia look, its words and its assets |
src/apps |
the apps we ship: CLIENT, CONNECT and SERVER, one head per platform and store |
tests |
the tests of the libraries and the apps |
docs |
the developer guides, published on developer.vpnhood.com |
pub |
the release scripts and the installers |
How the source is laid out goes through every folder.
Related repositories
| Repository | What it holds |
|---|---|
| VpnHood.App.Template | a white-label app template: your own VPN app from one app folder |
| VpnHood.App.Samples | small apps that use the engine and the app's logic |
| VpnHood.AppUi.Assets.Classic | the app's look: images, flags, fonts and the words of every language |
| VpnHood.App.Server | the releases of VpnHood! SERVER |
| Vpnhood.App.Connect | the releases of VpnHood! CONNECT |
Documentation
- developer.vpnhood.com: the guides, the samples, the libraries and the API reference
- Self-hosted VPN docs: install and run VpnHood! SERVER
- Changelogs: the apps, the NuGet packages, the server
Security audit
Include Security audited VpnHood for the Open Technology Fund's Red Team Lab. Read the report or what it means for you.
To report a vulnerability, follow the security policy.
Support and community
- Questions and ideas: GitHub Discussions
- Bugs and feature requests: GitHub Issues
- Email: [email protected]
- Follow us: LinkedIn, Facebook, Instagram and X
Contributions, feedback and stars are welcome: how to contribute.
License
VpnHood is open source under the GNU Lesser General Public License 2.1.
Thanks to ReSharper, which helps us write, improve and maintain our C# code.
探索相关项目
加载中…




