.NET Standard library SDK to help communicate with the AirVPN API.
AirVPN describes itself as:
A VPN based on OpenVPN and operated by activists and hacktivists in defence of net neutrality, privacy and against censorship.
More information can be found in the Links section below.
ByteDev.AirVpn is hosted as a package on nuget.org. To install from the Package Manager Console in Visual Studio run:
Install-Package ByteDev.AirVpn
Further details can be found on the nuget page.
Releases follow semantic versioning.
Full details of the release notes can be viewed on GitHub.
The main class in the assembly is AirVpnClient
and has four public methods which each act against the AirVPN API.
GetUserInfoAsync
(requires API key)SendNotificationAsync
(requires API key)DisconnectAsync
(requires API key)GetStatusInfoAsync
Example retrieving user info such as if the user is connected and the sessions they currently have:
// AirVPN API keys are available to users at: https://airvpn.org/apisettings/
const string ApiKey = "someApiKey";
// Create an instance of AirVpnClient
IAirVpnClient client = new AirVpnClient(new HttpClient());
// Get user info
var request = new GetUserRequest(ApiKey);
var response = await client.GetUserAsync(request);
// response.IsSuccessful (if false ErrorMessage should be set)
// response.ErrorMessage
// response.User
// response.Sessions
All date times are UTC (that aren't Unix date time).
It should be noted that AirVPN has specified that they will ban an IP address that sends more than 600 requests every 10 minutes.