diff --git a/README.md b/README.md index d4421ad..f31cf05 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ -**ZeroTier** makes it easy to securely connect devices, servers, cloud VMs, containers, and apps everywhere and manage them at scale. Now, with **libzt** you can bake this ability directly into your app or service using your preferred language or framework. We provide a BSD socket-like API to make the integration simple. +**ZeroTier** makes it easy to securely connect devices, servers, cloud VMs, containers, and apps everywhere and manage them at scale. Now, with **libzt** you can bake this ability directly into your app or service using your preferred language or framework. We provide a BSD socket-like API to make the integration simple and there's no longer any need for system-wide virtual interfaces. This connection is exclusive to your app.
@@ -19,9 +19,15 @@ Pre-Built Binaries Here: [zerotier.com/download.shtml](https://zerotier.com/down ``` #include "libzt.h" -char *str = "welcome to the machine"; -char *nwid = "c7cd7c9e1b0f52a2"; // network to join -char *pasth = "zt1" // path where this node's keys and configs will be stored +char *str = "welcome to the machine"; // test msg +char *nwid = "c7cd7c9e1b0f52a2"; // network to join +char *pasth = "zt1"; // path where this node's keys and configs will be stored +char *ip = "10.8.8.42"; // resource on ZeroTier network + +struct sockaddr_in addr; +addr.sin_family = AF_INET; +addr.sin_addr.s_addr = inet_addr(ip); +addr.sin_port = hton(8080); zts_simple_start(path, nwid); int fd = zts_socket(AF_INET, SOCK_STREAM, 0); @@ -30,14 +36,13 @@ zts_write(fd, str, strlen(str)); zts_close(fd); ``` -Bindings for various [LANGUAGES](examples) +Bindings for various [languages](examples) *** ### Building (linux, macos, bsd, win, ios) - Complete instructions here [PLATFORMS](BUILDING.md) - All build targets will output to `build/` + All build targets will output to `build/`. Complete instructions [here](BUILDING.md). - Static Library (linux, mac, win, bsd): `make static_lib` - iOS App Framework: `make ios_app_framework` diff --git a/TESTING.md b/TESTING.md index a0b9792..b180c73 100644 --- a/TESTING.md +++ b/TESTING.md @@ -1,8 +1,9 @@ ## Testing via [selftest.cpp](test/selftest.cpp) ### Enabling debug output - - `SDK_DEBUG=1` - For debugging libzt - - `ZT_DEBUG=1` - For debugging the ZeroTier core protocol + + - `SDK_DEBUG=1`: For debugging libzt + - `ZT_DEBUG=1`: For debugging the ZeroTier core protocol After building the static library, you can run: diff --git a/examples/README.md b/examples/README.md index efb6b2f..e71d52a 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,6 +1,5 @@ Language bindings -### Using Language Bindings - `SDK_LANG_JNI=1`: Enable JNI bindings for Java (produces a shared library) - `SDK_LANG_CSHARP=1` - `SDK_LANG_PYTHON=1` diff --git a/include/README.md b/include/README.md index 5c3216e..9e99921 100644 --- a/include/README.md +++ b/include/README.md @@ -1,4 +1,4 @@ -ZeroTier SDK API +libzt API ====== -This is the externally facing C++ API for the SDK. It provides a platform-agnostic interface to the ZeroTier network virtualization service. +This is the C++ API for libzt. It provides a platform-agnostic interface to the ZeroTier network virtualization service. All other [language bindings](../examples) are written in terms of this.