Husarnet is a Peer-to-Peer VPN to connect your laptops, servers and microcontrollers over the Internet with zero configuration.
Key features:
husarnet join <YOUR_JOINCODE> mydevname
(on Linux. See docs for other platforms).Husarnet, in it's core, is one big, automatically routed, IPv6 network. Running Husarnet daemon creates a virtual network interface (hnet0
) with an unique Husarnet IPv6 address and associated fc94::/16
route. If you choose to disable the permission system, any node can reach your node using IPv6 fc94:...
address, but if you choose to leave it enabled, we've prepared an extensive permissions system for you. You can have multiple virtual islands/networks, your devices can access multiple networks or you can even share access to those networks with other users!
The nodes are identified by their 112-bit IPv6 addresses, that are based on the public keys of the node. All connections are also authenticated by the IPv6 address. This property makes it possible to establish connection authenticity without any trusted third party, basing only on the IPv6 address! The connections are also always encrypted.
Cryptography: Husarnet uses X25519 from libsodium for key exchange, with ephemeral Curve25519 keys for forward secrecy. The hash of initial public key is validated to match the IPv6 address. The packets are encrypted using libsodium's ChaCha20-Poly1305 secretbox construction with a random 192-bit nonce.
Runtime safety: Husarnet is written in C++ using modern memory-safe constructs. Linux version drops all capabilities after initialization. It only retains access to /etc/hosts
and /etc/hostname
via a helper process.
If Husarnet instance is not connected to the Husarnet Dashboard, the whitelist (think of it as a crude firewall) and hostname table can only be changed by a local root
user. All the other configuration can be changed using the Husarnet Dashboard after you join
your device to a network there.
This is the main development repository for all of the Husarnet Client apps.
For more generic information please have a look at the Husarnet Docs.
Typical issues preventing Peer-to-Peer connection (thus enjoing a low-latency) and their workarounds are described in the Troubleshooting Guide.
util
directory - all the scripts and utilities used for building and testing. CI config should be referencing those in order to make local testing easierunix
directory - main dir for unix platform codetests
directory - unit (and other) tests (unit tests will run on x86_64 unix platform)deploy
directory - various files needed for deployment - like the static files in our repositories./util/build-prepare.sh
- will install all required toolchains, etc - tested on Ubuntu 20.10./util/version-bump.py
(keep in mind that all merges/commits to the default branch will to that automatically)./util/build-all.sh
./util/build-cmake.sh <architecture> <platform>
./util/test-prepare.sh
- will install required tools./util/test-all.sh
- will run ALL tests./util/test-cppcheck.sh
- will run cppcheck./util/test-unit.sh
- will build and run unit tests. Assumes host machine is x86 and runs some form of Unix./util/prepare-all.sh
- this will prepare both build and test environmentsThis project was possible thanks to:
Husarnet is dual-licensed:
See LICENSE.txt for details.