VpnHood.Net.VpnAdapters.AndroidTun 9.1.875

dotnet add package VpnHood.Net.VpnAdapters.AndroidTun --version 9.1.875
                    
NuGet\Install-Package VpnHood.Net.VpnAdapters.AndroidTun -Version 9.1.875
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="VpnHood.Net.VpnAdapters.AndroidTun" Version="9.1.875" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="VpnHood.Net.VpnAdapters.AndroidTun" Version="9.1.875" />
                    
Directory.Packages.props
<PackageReference Include="VpnHood.Net.VpnAdapters.AndroidTun" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add VpnHood.Net.VpnAdapters.AndroidTun --version 9.1.875
                    
#r "nuget: VpnHood.Net.VpnAdapters.AndroidTun, 9.1.875"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package VpnHood.Net.VpnAdapters.AndroidTun@9.1.875
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=VpnHood.Net.VpnAdapters.AndroidTun&version=9.1.875
                    
Install as a Cake Addin
#tool nuget:?package=VpnHood.Net.VpnAdapters.AndroidTun&version=9.1.875
                    
Install as a Cake Tool

VpnHood.Net.VpnAdapters.AndroidTun

The Android VPN adapter of VpnHood: the TUN interface that Android's VpnService gives an app, whose IP packets a VPN reads and writes. It implements VpnHood.Net.VpnAdapters.Abstractions.

dotnet add package VpnHood.Net.VpnAdapters.AndroidTun

How it works

  • AndroidVpnAdapter is an IVpnAdapter: make it inside your VpnService with the service and an AndroidVpnAdapterSettings, and use it as the Abstractions quick start uses NullVpnAdapter.
  • A start describes the interface to a VpnService.Builder (addresses, routes, DNS servers, MTU, session name and the apps to include or exclude), establishes it, and reads and writes packets through libc on its file descriptor.
  • The interface stays up when the device moves to other networks, which Android handles, and takes its meteredness from the networks under it. There is no NAT and no metric.
  • ProtectSocket keeps a socket, such as the one to the VPN server, out of the tunnel with VpnService.Protect.
  • GetPrimaryAdapterDnsServers gives the DNS servers of the validated networks under the VPN, which .NET does not list on Android.

Requirements

  • Android 7.0 (API level 24) or later, with .NET 11 for Android.
  • A VpnService in the app's manifest with the android.permission.BIND_VPN_SERVICE permission and an android.net.VpnService intent filter, and the app's android.permission.ACCESS_NETWORK_STATE permission, which GetPrimaryAdapterDnsServers needs.
  • VpnService.Prepare checked before each connection, with the user's consent asked when it returns an intent.

License

LGPL-2.1-only. See the VpnHood repository.

Product Compatible and additional computed target framework versions.
.NET net11.0-android37.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on VpnHood.Net.VpnAdapters.AndroidTun:

Package Downloads
VpnHood.Core.Client.VpnServices.Host.Android

VpnHood's VPN service on Android: the VPN service's half, which runs the engine

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.1.875 26 11/16/2026
9.1.874 46 11/15/2026
9.1.864 101 11/3/2026
9.0.860 107 10/31/2026
9.0.859.16-prerelease 95 10/30/2026
9.0.857 102 10/20/2026
9.0.856 102 10/19/2026
9.0.855 97 10/13/2026
8.2.853.11-prerelease 104 10/5/2026
8.2.853 136 9/23/2026
8.2.852 125 9/23/2026