tatsuhiro-t/wslay
FreeThe WebSocket library in C
About tatsuhiro-t/wslay
Wslay is a lightweight WebSocket library written in C, implementing protocol version 13 as defined in RFC 6455. It offers two API levels: an event-based API suited for non-blocking reactor patterns with user-defined callbacks, and a frame-based low-level API for direct WebSocket frame manipulation. The library supports text and binary messages, automatic ping replies, and integrates with external event loops. Wslay does not perform any I/O operations itself, relying on callback functions for all I/O, making it portable across platforms and independent of specific networking or SSL frameworks. It only handles the data transfer portion of the WebSocket protocol and does not perform the HTTP opening handshake. Licensed under MIT.
Key Features
Pros & Cons
- Lightweight and portable due to no built-in I/O dependencies
- Flexible API design with two abstraction levels
- Compliant with the standard WebSocket protocol (RFC 6455)
- Clean callback-based architecture for non-blocking use
- Free and open source (MIT license)
- Does not perform the HTTP opening handshake (requires separate handling)
- Only supports data transfer, not the full WebSocket lifecycle
- Limited to C language use
- No built-in SSL/TLS support (depends on external I/O code)