WindscribeNet is an (unofficial) .NET 8 library for controlling Windscribe via C#. It provides clean, typed access to VPN operations like getting status, connecting and disconnecting, firewall control, and IP checking.
(IP checking is not really a part of Windscribe and is done with https://api.ipify.org)
- Connect/disconnect to VPN
- Toggle firewall on/off
- Get connection status
- Wait until connected/disconnected
- Wait until a provided status is obtained
- Get current public IP
- .NET 8.0
- Windscribe CLI installed and available in
PATHor a known default location (this is installed when Windscribe is installed, see: https://windscribe.com/download/) - Tested on Windows 10. Linux support is currently untested but likely compatible
Just click install on the nuget package.
using WindscribeNet;
StatusCommandResponse status = await Windscribe.GetStatusAsync();
Console.WriteLine(status.ConnectState.State); // Connected / Disconnectedawait Windscribe.ConnectAsync();
await Windscribe.WaitUntilConnectedAsync();(Note: The ConnectAsync() only returns when Windscribe does so because it's done connecting but adding the WaitUntilConnectedAsync() afterwards just makes sure that it definitely is connected by checking the status too.)
await Windscribe.DisconnectAsync();
await Windscribe.WaitUntilDisconnectedAsync();(Note: see the note on the connection example above, the same goes for this.)
using WindscribeNet.Enums;
await Windscribe.SetFirewallAsync(ActiveState.Off);
await Windscribe.SetFirewallAsync(ActiveState.On);string ip = await IpAddressHelper.GetCurrentAsync();
Console.WriteLine($"IP address: {ip}");MIT (do whatever you want with it, you're welcome to contribute to the repository if you have any improvements.)
Thanks to the creators of Windscribe for building a solid VPN product and for making parts of their code available as open source.
This library would not have been possible without the insights gained from their CLI implementation.