Can libzt be used in the same way the official ZeroTier client can?


I have a few simple questions, just to see if I understood the purpose of the libzt properly.

If I make a C application that links in libzt and, when run, calls zts_start(…) + zts_join(), and then run that app on 2 different computers, those computer will be able to ping each other (and otherwise communicate) using the Managed IPs found on the network dashboard (after they are authorized in the group), correct? Assume that all the required events are produced as expected (NODE_UP, NODE_ONLINE etc.)

Basically - if will behave as though I had installed the official ZeroTier client on those computers?

Is libzt compatible with using other socket interfaces (for example, WinSock or SFML.networking), or do I have to use the provided zts_* functions in order for it to work?

Is there a relevant difference in how ZeroTier handles TCP and UDP comunication?

Thanks, Cheers :slight_smile:

1 Like

No. libzt allows you to add an application to a network and only that application will be able to communicate over it via the zts_* functions. It is not a full zerotier-one client that adds a virtual network adapter to the machine, and no other programs running on the computer will be able to communicate on the network unless they too are using libzt, or there’s a full zerotier install on the machine.

libzt can only communicate over networks via the supplied zts_* function interfaces.


Thank you, that explains a lot.
Next task: learn how to use ZT sockets :slight_smile:

That part should be pretty straightforward. For C, it’s modeled after the classic Berkeley socket interface. All the function names are the same, but prepended with zts_. Everything else should remain the same. You can also check here for Beej’s Guide to Network Programming. It’s pretty much the defacto guide to network programming with C. Been around forever and is still updated.

1 Like

Wow, this guide is awesome - exactly what I need! Thanks again :slight_smile:

An update on libzt.

The 1.4.X API refresh is complete, all packages have now been updated and new documentation is out. We’ll be hosting a webinar on June 2nd where anyone is invited to ask questions or make feature requests.

Relevant links can be found here: New Documentation / Webinar · Issue #120 · zerotier/libzt · GitHub