A tiny, embeddable C99 WebSocket server library.
- Server-side WebSocket handshake with path and optional subprotocol negotiation.
- IPv4/IPv6/UNIX-domain sockets.
- User-supplied event-loop hooks for read/write readiness and timers.
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build buildTo install:
cmake --install buildHeaders can be included with #include <tiny-websocket/tws.h>
Please refer to tws.h for detailed API documentation.
Please refer to test_tws.c for an echo server example.
- Install tev from source.
- Build tests:
cmake -S test -B test/build
cmake --build test/build- Start the echo server
./test/build/test_tws # starts echo server on 127.0.0.1:24371 path /ws- Run the JavaScript client (in another session)
cd test && npm install # install JS deps (once)
node test_tws.js # runs the WebSocket client against the serverThis project uses Brad Conte's crypto-algorithms for websocket handshake purposes.