Streaming socket with optional TLS/SSL encryption support.
SecureStreamingSocket provides a unified interface for both secure (HTTPS/TLS) and non-secure (HTTP) streaming socket connections. It wraps mbedTLS for secure connections and falls back to JUCE's StreamingSocket for non-secure connections.
Key Features:
- TLS/SSL support via mbedTLS
- Fallback to plain sockets when security not required
- Blocking and non-blocking read modes
- Timeout support for connections and reads
- Compatible with WebSocket and HTTP implementations
Usage:
if (socket.connect("example.com", 443, 3000))
{
const char*
request =
"GET / HTTP/1.1\r\nHost: example.com\r\n\r\n";
char buffer[1024];
int bytesRead = socket.read(buffer,
sizeof(buffer),
false);
{
}
socket.close();
}
A lightweight 2D point class for projects that don't use juce_graphics.
Definition gin_point.h:25
Streaming socket with optional TLS/SSL encryption support.
Definition gin_securestreamingsocket.h:54
Thread Safety: Not thread-safe. Use from a single thread or provide external synchronization.
- See also
- WebSocket, Http, AsyncWebsocket