A library providing generic interface for transferring data over a network across different platforms.
- Blocking / non-blocking socket
- Stream client / server (TCP)
- Datagram client / server (UDP)
- Secure socket layer (OpenSSL)
- Datagrams over TCP stream
- HTTP client (TLS, Compression)
- Ubuntu
- MacOS
- Windows
- C99 compiler
- Git 2.30+
- CMake 3.22+
- vcpkg (Windows only)
- brew (macOS only)
- Ubuntu: sudo apt-get install libssl-dev
- macOS: brew install openssl
- Windows: vcpkg install openssl
Name | Description | Default value |
---|---|---|
NETS_BUILD_SHARED | Build Nets shared library | ON |
NETS_BUILD_EXAMPLES | Build Nets usage examples | ON |
NETS_USE_OPENSSL | Use OpenSSL for secure communication | ON |
NETS_ALLOW_DEPRECATED_SSL | Allow deprecated OpenSSL functions | OFF |
git clone --recursive https://github.com/cfnptr/nets
Datagram client / server example: examples/datagram_example.c
HTTPS client (OpenSSL) example: examples/https_example.c