Skip to content
wavexVPNPublic

About

WAVEX SDK: add a post-quantum WAVEX VPN connection to your app. C library (Windows preview), guide and examples.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

WAVEX SDK

Add a WAVEX VPN connection to your own app: post-quantum (X25519 + ML-KEM-768), one round trip to connect, roaming between networks, kill switch, DNS and IPv6 leak protection. Open Networking. Private by Design.

The SDK is a C library, so you can use it from C, C++, C#/.NET, Rust, Go (cgo), Python, Delphi or Flutter (FFI).

Platform Library Status
Windows 10 / 11, x64 wavex.dll Preview (download)
Android, iOS, macOS, Linux — Planned

Quick start

  1. Download wavex-sdk-<version>-windows-amd64.zip from the latest release and check its SHA-256 against SHA256SUMS.
  2. Ship wavex.dll and wintun.dll next to your program. Include include/wavex.h.
  3. Get a device file: on your WAVEX gateway, sudo wavex-gateway add NAME writes NAME.wavex (run your own gateway in a few minutes).
  4. Connect:
#include "wavex.h"

static void on_event(const char *json, void *user) { printf("%s\n", json); }  /* {"state":"connected","message":"..."} */

int64_t h = wavex_create(device_file_contents, "{\"route_all\": true}", on_event, NULL);
if (!h) { char *e = wavex_last_error(); fprintf(stderr, "%s\n", e); wavex_free(e); return 1; }
if (!wavex_connect(h, 30000)) { /* wavex_last_error() says why */ }
char *st = wavex_status(h);   /* {"state":"connected","tunnel_ipv4":"10.69.0.2", ...} */
wavex_free(st);
wavex_disconnect(h);
wavex_destroy(h);

Full examples: C · C# · Python

The API

All of it is in include/wavex.h.

Function What it does
wavex_create(device_file, options_json, cb, user) Prepares a connection from a .wavex file's contents. Returns a handle, or 0.
wavex_connect(h, timeout_ms) Handshakes and brings the tunnel up. Blocks until connected (1) or failed (0): call it from a background thread.
wavex_disconnect(h) Closes the tunnel and undoes the network settings.
wavex_status(h) The connection as JSON.
wavex_destroy(h) Disconnects if needed and frees the handle.
wavex_last_error() Why the last call failed.
wavex_version() The library version.
wavex_free(s) Frees any string the library returned.

Options (options_json, all optional):

Key Default Meaning
route_all false Send all traffic through the tunnel. Otherwise only the tunnel's network.
kill_switch false While connected, block everything that doesn't go through the tunnel, DNS included. See below.
adapter_name "WAVEX" The name of the network adapter Windows shows.
device_info "" What this device is, shown to the gateway's operator, e.g. "MyApp 1.2 · Windows 11".

Events. cb is called on a library thread for every change: {"state": "...", "message": "..."} with state one of disconnected, connecting, connected, reconnecting. The string is valid only during the call; copy it if you keep it. Don't call wavex_destroy from inside the callback.

Status JSON: state, server, tunnel_ipv4, tunnel_ipv6 (empty without IPv6), dns (list), connected_at, last_handshake (RFC 3339), rx_bytes, tx_bytes.

After connecting the connection keeps itself up: it reconnects after Wi-Fi/mobile changes and when the gateway restarts, until you call wavex_disconnect.

Requirements on Windows

  • Administrator rights: creating the network adapter and changing routes needs them. Most apps run the VPN part as a Windows service and talk to it from the UI.
  • wintun.dll next to wavex.dll: it's in the release zip (Wintun is the signed driver WireGuard uses, wintun.net).
  • Kill switch: the program must run as a Windows service with its own service SID (SERVICE_SID_TYPE_UNRESTRICTED); the block rules let traffic through by that SID. In an ordinary program, wavex_connect with kill_switch: true fails instead of connecting unprotected. Windows removes the rules if the process exits or crashes, so a computer is never left offline.
  • One connection at a time per program.

Using it from…

  • C# / .NET: P/Invoke, see examples/csharp/Wavex.cs. Keep a reference to the callback delegate for as long as the connection lives.
  • Python: ctypes, see examples/python/connect.py.
  • Rust: bindgen on wavex.h, link wavex.dll.
  • Flutter / Dart: dart:ffi with ffigen on wavex.h (Windows desktop).

Verify a download

Get-FileHash .\wavex-sdk-0.1.0-windows-amd64.zip -Algorithm SHA256   # compare with SHA256SUMS

Licence and support

The SDK is free to use for building apps that connect to WAVEX gateways. The WAVEX protocol's source is public (Business Source License 1.1, Apache-2.0 four years after each release): wavexVPN/wavex. Questions and bugs: Issues. Security issues: WAVEX security policy.


Built by WAVEINNO.

About

WAVEX SDK: add a post-quantum WAVEX VPN connection to your app. C library (Windows preview), guide and examples.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages