mcpp index

compat.websocket

#include

IXWebSocket — pure C++ WebSocket client (RFC 6455), client-only, zero deps

#include <ixwebsocket/IXConnectionState.h>
mcpp add compat.websocket@12.0.1

Usage

From this repository's own test project — built and run by CI, not written for the website.

// ws_features_test.cpp — asserts compat.websocket's `server` and `zlib`
// features, enabled through the member's dependency declaration.
//
//   * `server`: an ix::WebSocketServer runs inside the test process on
//     loopback and echoes every message; the client's round-trips go through
//     the REAL server class (the sibling member tests/examples/websocket uses
//     a hand-written raw-socket echo server precisely so the zero-dep client
//     is tested against something independent — here the point is the opposite:
//     prove the compiled-in server works).
//   * `zlib`: the client enables per-message-deflate. A highly-compressible
//     payload must come back as a message whose str is the full payload but
//     whose wireSize is the COMPRESSED frame bytes (the transport delivers
//     str = decompressed content and wireSize = raw wire payload), which is
//     how a compression round-trip is observable without sniffing the socket.
//
// No network access is required; everything stays on 127.0.0.1.

#include <ixwebsocket/IXConnectionState.h>
#include <ixwebsocket/IXNetSystem.h>
#include <ixwebsocket/IXWebSocket.h>
#include <ixwebsocket/IXWebSocketMessage.h>
#include <ixwebsocket/IXWebSocketServer.h>
// …

tests/examples/websocket-features/tests/ws_features_test.cpp · project tests/examples/websocket-features

Build

targets
websocket (lib)
language
c++23
import std
no
include dirs
*

Features

featuredeclares
zlibdeps, defines
serverimplies, sources

Sources (32)

  • */ixwebsocket/IXBench.cpp
  • */ixwebsocket/IXCancellationRequest.cpp
  • */ixwebsocket/IXConnectionState.cpp
  • */ixwebsocket/IXDNSLookup.cpp
  • */ixwebsocket/IXExponentialBackoff.cpp
  • */ixwebsocket/IXGetFreePort.cpp
  • */ixwebsocket/IXGzipCodec.cpp
  • */ixwebsocket/IXHttp.cpp
  • */ixwebsocket/IXHttpClient.cpp
  • */ixwebsocket/IXNetSystem.cpp
  • */ixwebsocket/IXSelectInterrupt.cpp
  • */ixwebsocket/IXSelectInterruptFactory.cpp
  • */ixwebsocket/IXSelectInterruptPipe.cpp
  • */ixwebsocket/IXSelectInterruptEvent.cpp
  • */ixwebsocket/IXSetThreadName.cpp
  • */ixwebsocket/IXSocket.cpp
  • */ixwebsocket/IXSocketConnect.cpp
  • */ixwebsocket/IXSocketFactory.cpp
  • */ixwebsocket/IXSocketTLSOptions.cpp
  • */ixwebsocket/IXStrCaseCompare.cpp
  • */ixwebsocket/IXUdpSocket.cpp
  • */ixwebsocket/IXUrlParser.cpp
  • */ixwebsocket/IXUuid.cpp
  • */ixwebsocket/IXUserAgent.cpp
  • */ixwebsocket/IXWebSocket.cpp
  • */ixwebsocket/IXWebSocketCloseConstants.cpp
  • */ixwebsocket/IXWebSocketHandshake.cpp
  • */ixwebsocket/IXWebSocketHttpHeaders.cpp
  • */ixwebsocket/IXWebSocketPerMessageDeflate.cpp
  • */ixwebsocket/IXWebSocketPerMessageDeflateCodec.cpp
  • */ixwebsocket/IXWebSocketPerMessageDeflateOptions.cpp
  • */ixwebsocket/IXWebSocketTransport.cpp

Versions

VersionPlatforms Mirrorssha256
12.0.1 latest LinuxWindowsmacOS source d23bdc91dbfe…