Synchronous WebSocket client implementation.
WebSocket provides a blocking WebSocket client based on the RFC 6455 protocol. Originally based on easywsclient, heavily refactored for JUCE integration. Supports both text and binary messages, ping/pong, and secure connections.
Key Features:
- WebSocket protocol (RFC 6455) implementation
- Text and binary message support
- Ping/pong keep-alive
- TLS/SSL support via SecureStreamingSocket
- Optional frame masking (required for client-to-server)
- Custom headers for authentication/protocols
Connection States:
- OPEN: Connected and ready
- CLOSING: Close handshake initiated
- CLOSED: Connection closed
Usage:
{
ws->send(
"Hello, server!");
ws->dispatch([](
const juce::MemoryBlock& data,
bool isBinary) {
if (!isBinary)
{
juce::String
msg = data.toString();
}
});
}
A lightweight 2D point class for projects that don't use juce_graphics.
Definition gin_point.h:25
static WebSocket * fromURL(const juce::String &url, const juce::String &origin={})
Note: This is a synchronous (blocking) implementation. For asynchronous operations with callbacks, use AsyncWebsocket instead.
- See also
- AsyncWebsocket, SecureStreamingSocket, WSHeaderType