Skip to content

HavenDV/H.Vpn

Repository files navigation

H.Vpn

A set of C# libraries for VPN implementation

Features

  • Supports firewall that will block the internet if there are connection problems.
  • Based on OpenVPN

Nuget

NuGet
NuGet
NuGet
NuGet
NuGet

Usage

H.Firewall

Forbids for 15 seconds everything except LAN/DNS/Localhost requests and Chrome applications.
NOTE: To use this code in your application, you must either run it as an administrator or run it through a service talking to it via IPC (eg H.Pipes). Else you will get the following error: 0x8032000D. The call must be made from within an explicit transaction.

using var firewall = new FirewallBuilder()
    .Block()
    .All()
    .Allow()
    .Localhost()
    .DomainNameSystem()
    .LocalAreaNetwork()
    .Application(@"C:\Users\haven\AppData\Local\Google\Chrome\Application\chrome.exe")
    .Build();

await Task.Delay(TimeSpan.FromSeconds(15));

H.Firewall uses WFP calls internally, you can learn more about this.

Links

Contacts