• Stars
    star
    165
  • Rank 228,906 (Top 5 %)
  • Language
    C++
  • License
    Other
  • Created over 8 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Encrypted P2P sockets over ZeroTier

ZeroTier Sockets

Part of the ZeroTier SDK

P2P cross-platform encrypted sockets library using ZeroTier


Examples | Docs | Report an issue

@zerotier r/zerotier

latest libzt version Last Commit Build Status (master branch)

Language/Platform Install Version Example
C/C++ Build from source version C/C++
C# Install-Package ZeroTier.Sockets C#
Python pip install libzt Python
Rust See: crates.io/crates/libzt version Rust
Java Install JDK, then: ./build.sh host-jar Java
Linux brew install zerotier/tap/libzt version C/C++
macOS brew install zerotier/tap/libzt version C/C++
iOS / iPadOS ./build.sh iphoneos-framework Objective-C, Swift
Android ./build.sh android-aar Java

#include "ZeroTierSockets.h"

int main()
{
    zts_node_start();
    zts_net_join(net_id);
    int fd = zts_bsd_socket(ZTS_AF_INET, ZTS_SOCK_STREAM, 0);
    zts_bsd_connect(fd, ...);
    ...
}

Build from source (optional)

git submodule update --init

This project uses CMake as a build system generator. The scripts build.* simplify building and packaging for various targets. There are many targets and configurations not mentioned here.

Platform Build instructions Notes
Linux ./build.sh host "release" build.sh
macOS ./build.sh host "release" build.sh
Windows . .\build.ps1; Build-Host -BuildType "Release" -Arch "x64" build.ps1, Requires PowerShell

Using the host keyword will automatically detect the current machine type and build standard libzt for use in C/C++ (no additional language bindings.) See ./build.sh list for additional target options. libzt depends on cURL for the optional portion of the API that interfaces with our hosted web offering (my.zerotier.com). If you do not need this functionality you can omit it by passing -DZTS_DISABLE_CENTRAL_API=1 to CMake.

Example output:

~/libzt/dist/macos-x64-host-release
β”œβ”€β”€ bin
β”‚Β Β  β”œβ”€β”€ client
β”‚Β Β  β”œβ”€β”€ server
β”‚Β Β  └── ...
└── lib
    β”œβ”€β”€ libzt.a
    └── libzt.dylib

Important directories:

Directory Purpose
dist Contains finished targets (libraries, binaries, packages, etc.)
cache Contains build system caches that can safely be deleted after use.
pkg Contains project, script and spec files to generate packages.

Self-hosting

If you'd like to use your own infrastructure we make it easy to set up your own controllers and roots.

Help

Licensing

ZeroTier and the ZeroTier SDK (libzt and libztcore) are licensed under the BSL version 1.1. ZeroTier is free to use internally in businesses and academic institutions and for non-commercial purposes. Certain types of commercial use such as building closed-source apps and devices based on ZeroTier or offering ZeroTier network controllers and network management as a SaaS service require a commercial license. A small amount of third party code is also included in ZeroTier and is not subject to our BSL license. See AUTHORS.md for a list of third party code, where it is included, and the licenses that apply to it. All of the third party code in ZeroTier is liberally licensed (MIT, BSD, Apache, public domain, etc.). If you want a commercial license to use the ZeroTier SDK in your product contact us directly via [email protected]

More Repositories

1

ZeroTierOne

A Smart Ethernet Switch for Earth
C++
13,975
star
2

lf

Fully Decentralized Fully Replicated Key/Value Store
C
888
star
3

awesome-zerotier

A collection of things you can do with ZeroTier, how-to guides, and more
797
star
4

zeronsd

A DNS server for ZeroTier users
Rust
500
star
5

ZeroTierNAS

NAS packages for ZeroTier
JavaScript
442
star
6

toss

Dead simple LAN file transfers from the command line
C
396
star
7

DesktopUI

ZeroTier Desktop Tray Application and UI
C
165
star
8

terraform-provider-zerotier

Terraform provider for controlling ZeroTier Central
Go
67
star
9

install.zerotier.com

Source for https://install.zerotier.com curl|bash installer
Shell
62
star
10

zerotier-systemd-manager

Manages systemd per-interface DNS resolution for zeronsd
Go
61
star
11

github-action

A Github Action for ZeroTier
JavaScript
44
star
12

edge

ZeroTier Edge software and root filesystem (AARCH64)
Perl
38
star
13

cathode

Demo App for ZeroTier SDK
C
27
star
14

terraform-multicloud-quickstart

A tutorial using ZeroTier + Terraform on multiple clouds
HCL
24
star
15

dumb

Dumb User Mode Bridge
C
21
star
16

pylon

SOCKS5 Proxy to and from your LAN and ZeroTier Network
C++
18
star
17

tetanus

ZeroTier in (almost) pure Rust WORK IN PROGRESS
Rust
16
star
18

zerotier-synology

Dockerfile
15
star
19

go-ztcentral

Golang Client for ZeroTier Central
Go
13
star
20

docs

ZeroTier docs site
HTML
11
star
21

chef-zerotier

Chef recipe for ZeroTier One
Ruby
11
star
22

homebrew-tap

Homebrew tap for ZeroTier
Ruby
11
star
23

coyote

A lightweight, embeddable ACME server with traits management for storage and challenges
Rust
10
star
24

terraform-quickstart

ZeroTier Terraform Quickstart
HCL
8
star
25

go-ztidentity

ZeroTier Identity Generation Library for Go
Go
8
star
26

zerotier-sockets-apple-framework

Use a ZeroTier node in your macOS, iOS, iPadOS Swift or Objective-C application
C++
7
star
27

nat-emulation

A rusty NAT emulation library.
Rust
6
star
28

terraform-zerotier-network

ZeroTier Network Terraform Module
HCL
5
star
29

zeronsd-quickstart

5
star
30

ratpack

A simpleton's HTTP framework for rust-lang
Rust
5
star
31

zssp

ZeroTier Secure Sessions Protocol
Rust
5
star
32

crypto-glue

Security utility functions and cryptographic API glue code.
Rust
3
star
33

terraform-zerotier-member

ZeroTier Member Terraform Module
HCL
2
star
34

ztchooks

Primitives for serializing and verifying hooks fired from ZeroTier Central
Go
2
star
35

go-zerotier-one

ZeroTierOne service API via deepmap/oapi-codegen
Shell
2
star
36

identity

ZeroTier legacy V1 (x25519) and new (p384) identity and address implementations with common traits.
Rust
2
star
37

libzt-android-examples

libzt Android Examples
Java
1
star
38

common-utils

Rust language common utilities used by multiple ZeroTier crates in Rust.
Rust
1
star
39

udwee

Fast UDP I/O library
Rust
1
star
40

sequential-exchange

The reference implementation of the Sequential Exchange Protocol
Rust
1
star
41

ca_injector

Certificate Authority injector library for Rust
Rust
1
star
42

zerotier-rust-api

Rust API crates for Central and ZeroTierOne
Rust
1
star
43

eggshell

A Rust library to manage containers in tests
Rust
1
star
44

zt

Rust
1
star
45

helm-charts

ZeroTier
Smarty
1
star
46

ztchooks-ts

Hook verification for hooks fired from ZeroTier Central
TypeScript
1
star
47

zerotier-one-api-spec

ZeroTier
TypeScript
1
star