8000 GitHub - ASA-D/libzt: Encrypted P2P sockets over ZeroTier
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ASA-D/libzt

 
 

Repository files navigation

ZeroTier Sockets

ZeroTier SDKの一部

クロスプラットフォームなP2P暗号化接続を、貴方のアプリケーションやサービスに直接組み込むことができます。ドライバ、ルート、ホスト構成は不要です。


| ドキュメント | コミュニティ | バグを知らせる

@zerotier r/zerotier

latest libzt version Last Commit Build Status (master branch)

言語/プラットフォーム インストール方法 バージョン
C/C++ ソースコードからビルド version C/C++
C# Install-Package ZeroTier.Sockets C#
Python pip install libzt Python
Rust crates.io/crates/libztを参照 version Rust
Java ./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, ...);
    ...
}

ソースコードからビルド

git submodule update --init

このプロジェクトでは、ビルドシステムとして CMake を使用しています。 スクリプト build.* は、様々なターゲットに対するビルドとパッケージングを簡略化します。 ここに記載されていないターゲットやコンフィギュレーションも多数存在します。

プラットフォーム ビルド方法 ノート
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, 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 (Optional)

We provide ways for your app or enterprise to function independently from any of our services if desired.

While we do operate a global network of redundant root servers, network controllers and an admin API/UI called Central, some use-cases require full control over the infrastructure and we try to make it as easy as possible to set up your own controllers and root servers: See here to learn more about how to set up your own network controller, and here to learn more about setting up your own 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 contact@zerotier.com

About

Encrypted P2P sockets over ZeroTier

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 69.4%
  • C 10.3%
  • C# 5.9%
  • Java 5.0%
  • Rust 3.0%
  • Python 2.0%
  • Other 4.4%
0