zSockets is a from-scratch zig implementation of the µSockets library. The name is a play on µSockets, where the "µ" represents the metric prefix for micro (1e−6); here, the z represents the metric prefix for zepto (1e-21) and the Zig programming language.
Clone the repository and its submodules:
git clone --recurse-submodules [email protected]:cryptodeal/zSockets.gitOnce cloned, recursively init submodules:
git submodule update --init --recursiveTo build with boringssl and quic:
zig build -DUSE_BORINGSSL -DUSE_QUICTo test with boringssl and quic:
zig build test -DUSE_BORINGSSL -DUSE_QUICEnsure that you've cloned the repository and its submodules:
git clone --recurse-submodules [email protected]:cryptodeal/zSockets.gitzig build echo_serverIn another terminal:
curl localhost:3000zig build hammer_test# args: <connections> <host> <port>
zig build http_load_test -- 10000 127.0.0.1 3000zig build http_serverIn browser navigate to localhost:3000
# args: <connections> <host> <port>
zig build tcp_load_test -- 10000 127.0.0.1 3000zig build tcp_serverIn another terminal:
nc 127.0.0.1 3000While the library and internal logic was originally based on uSockets, the user-facing APIs will vary significantly from uSockets in order to better align with Zig's philosophy. The library is currently in the VERY early stages of development, is un-tested, and should not yet be used in production.
- BoringSSL (default, optionally specified via build flag:
-DUSE_BORINGSSL)- add/link dependency
- fleshed out API
- OpenSSL (build flag:
-DUSE_OPENSSL)- add/link dependency
- fleshed out API
- wolfSSL (build flag:
-DUSE_WOLFSSL)- add/link dependency
- fleshed out API
- io_uring (build flag:
-DUSE_IO_URING)- fleshed out API
- epoll (build flag:
-DUSE_EPOLL)- fleshed out API
- kqueue (build flag:
-DUSE_KQUEUE)- fleshed out API
- asio (build flag:
-DUSE_ASIO)- add/link dependency
- fleshed out API
- gcd (build flag:
-DUSE_GCD)- add/link dependency
- fleshed out API
- libuv
- add/link dependency
- fleshed out API
- lsquic (build flag:
-DUSE_QUIC)- add/link dependency
- fleshed out API
- purge zig's C ABI compatability types where possible