webcpp::beast is a C++20 compatibility facade for Boost.Beast applications.
Its purpose is to make those applications usable in WebAssembly through
Emscripten or WASIp2/P3, with explicit adaptations where the host has different
network facilities. JSPI and Asyncify are Emscripten suspension variants;
they are not WASI versions. Native upstream-equivalent types, including the
WebSocket stream, are aliases of the actual Boost.Beast types.
It preserves Boost.Beast’s messages, buffers and parsers while selecting a
transport appropriate to the program’s environment. Native and WASIp2/P3 socket
programs use the guest protocol engine. Browser clients use WebSocket and fetch;
WASI host HTTP programs use the host’s request and response resources.
The application matrix distinguishes direct source compatibility from explicit
counterparts, since a browser client and a host HTTP handler do not own a TCP
listener.
Tutorial: construct a response
Use the library at libs/beast in the WebCPP superproject, with Boost 1.92 and B2
configured. This first example handles an in-memory request; it opens no connection.
http::response<http::string_body> handle_request(const http::request<http::string_body>& request) {
http::response<http::string_body> response{http::status::ok, request.version()};
response.set(http::field::content_type, "text/plain");
response.body() = "Hello from WebCPP\n";
response.prepare_payload();
return response;
}
int main() {
const http::request<http::string_body> request{http::verb::get, "/hello", 11};
const auto response = handle_request(request);
std::cout << response.result_int() << ' ' << response.reason() << '\n';
std::cout << response[http::field::content_type] << '\n';
std::cout << response.body();
}
From the superproject root, run:
unset CPATH CPLUS_INCLUDE_PATH C_INCLUDE_PATH
b2 -a libs/beast/example//http_message.output
The expected output is captured from the same example compiled against upstream Beast:
200 OK text/plain Hello from WebCPP
The successful finish is a matched .output target. Compiling the executable alone
does not check its result.
Exchange a message in the browser
Configure Emscripten and the project’s pinned Chrome. The browser driver serves controlled local peers and the compiled page, runs JSPI and Asyncify, and checks the page’s result. It does not substitute Node for the browser.
b2 -a toolset=emscripten variant=release libs/beast/example/browser//browser
The example resolves the local test peer and records its authority. These operations then exchange a text message through the browser’s WebSocket:
beast::websocket::stream<beast::tcp_stream> socket(io);
beast::get_lowest_layer(socket).connect(addresses, ec);
if (ec) {
return 1;
}
// These synchronous operations suspend into the browser event loop.
socket.handshake(host, "/echo", ec);
if (ec) {
return 1;
}
socket.text(true);
socket.write(net::buffer("hello", 5), ec);
if (ec) {
return 1;
}
beast::flat_buffer incoming;
socket.read(incoming, ec);
if (ec || beast::buffers_to_string(incoming.data()) != "hello") {
return 1;
}
socket.close(beast::websocket::close_code::normal, ec);
if (ec) {
return 1;
}
The synchronous interface suspends the C++ stack while the browser handles the operation. Use the Asio suspension configuration supplied by the B2 dependency; blocking the browser thread would prevent the event that completes the wait.
The same example sends an HTTP message through fetch and validates the response:
beast::tcp_stream stream(io);
stream.connect(addresses, ec);
if (ec) {
return 1;
}
beast::http::request<beast::http::string_body> request{beast::http::verb::post, "/http", 11};
request.set(beast::http::field::host, host);
request.body() = "hello";
request.prepare_payload();
beast::http::write(stream, request, ec);
if (ec) {
return 1;
}
beast::http::response<beast::http::string_body> response;
incoming.consume(incoming.size());
beast::http::read(stream, incoming, response, ec);
if (ec || response.result_int() != 200 || response.body() != "hello") {
return 1;
}
stream.socket().shutdown(net::ip::tcp::socket::shutdown_both, ec);
if (ec) {
return 1;
}
A successful page prints browser tutorial: ok; the driver requires that result
for both suspension variants. The controlled peer uses loopback HTTP. Production
HTTPS/WSS connections use the browser’s certificate validation and trust store.
Handle a host HTTP request
The WASI example receives an HTTP request from the host and returns a Beast response. The host owns the listener, connection and any HTTPS termination:
// Copyright (c) 2026 WebCpp.org
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
#include <webcpp/beast/wasi/http.hpp>
namespace http = webcpp::beast::http;
namespace {
/** Application routing and response construction, independent of listener ownership. */
http::response<http::string_body> handle_request(http::request<http::string_body> request) {
http::response<http::string_body> response{http::status::ok, request.version()};
response.set(http::field::content_type, "text/plain");
if (request.target() == "/health") {
response.body() = "ready\n";
} else {
response.body() = request.body();
}
response.prepare_payload();
return response;
}
} // namespace
// The host owns the listener and any HTTPS trust policy.
WEBCPP_BEAST_WASI_HTTP_EXPORT(handle_request)
b2 -a toolset=clang-wasip2 variant=release libs/beast/example/wasi//http
b2 -a toolset=clang-wasip3 variant=release libs/beast/example/wasi//http
The served test checks the health response and echoed request body against the example’s recorded request transcript. A failed response, timeout or mismatch fails the test. Supplying a guest TCP acceptor is unnecessary for this backend.
How-to: select a dependency and target
| B2 dependency | Purpose |
|---|---|
|
Portable buffers, HTTP messages, parsers and serializers. |
|
Native/WASIp2/P3 guest socket algorithms and Asio configuration. |
|
Guest-owned TLS with source-built OpenSSL. |
|
Browser-owned WebSocket, fetch and TLS policy. |
|
WASIp2/P3 host HTTP resources, without guest sockets or OpenSSL. |
|
Explicit supplied-stream counterparts, including WASI CLI input/output. |
Include <webcpp/beast/http/read.hpp> and <webcpp/beast/http/write.hpp> explicitly
for byte-stream operations, and <webcpp/beast/tcp_stream.hpp> or
<webcpp/beast/websocket.hpp> for the socket types. The convenience header omits
these transport headers and <webcpp/beast/ssl.hpp>.
Select the dependency for the transport the application actually uses. A WASI host HTTP handler does not need the guest socket or TLS dependency. Combining backends is explicit, for example a WASIp3 service that accepts host HTTP requests and separately contacts a TCP service.
Build without B2
Use webcpp/beast/ headers and webcpp::beast names, together with the
corresponding webcpp::asio types. Native equivalents are actual Boost types.
Wasm selects the versioned protocol implementation shipped in the library;
the maintainer importer is not a consumer build step, and no replacement Boost
include tree is needed. Boost 1.92 remains an explicit dependency for other
Boost facilities used by these headers.
Socket and browser programs compile Asio’s target-specific runtime source and use matching thread, exception and suspension settings. Guest TLS adds the explicit OpenSSL and CA provider. Host HTTP instead needs the bindings generated from the selected WASI world. These are different dependency contracts, not automatic substitutions based on an HTTP URL.
The superproject’s tools/test/fixtures/portable-network/CMakeLists.txt builds
HTTP and WebSocket consumers from copied source distributions with explicit
toolchain and dependency inputs. It uses the same implementation as B2.
Application-matrix and measurement results identify their tested revision;
historical results do not validate this distribution migration.
b2 -a variant=release exception-handling=on,off libs/beast/test libs/beast/example
b2 -a toolset=clang-wasip2 testing.launcher=tools/boost/asio-wasip2/run.sh exception-handling=on,off libs/beast/test libs/beast/example
b2 -a toolset=clang-wasip3 testing.launcher=tools/boost/asio-wasip3/run.sh exception-handling=on,off libs/beast/test libs/beast/example
b2 -a toolset=emscripten exception-handling=on,off libs/beast/test libs/beast/example
WASIp3 socket tests require the launcher’s loopback networking capabilities. Production hosts should grant only the capabilities their application needs.
Configure error policy
webcpp-beast-unsupported=error is the default; ignore is the alternative intended
for documented host-adapter restrictions. It does not make an unavailable transport
work. The B2 feature defines exactly one of WEBCPP_BEAST_UNSUPPORTED_ERROR and
WEBCPP_BEAST_UNSUPPORTED_IGNORE. Defining both fails compilation.
WEBCPP_BEAST_NO_EXCEPTIONS follows <webcpp/config.hpp> and can also be defined by
the application. WEBCPP_NO_EXCEPTIONS applies to all WebCPP libraries. These macros
do not change the compiler configuration or remove upstream Boost overloads; use
exception-handling=off for a complete build without exception handling. Prefer
upstream error-code overloads when recovery is required.
Explanation: separate messages from transport
Boost.Beast’s general headers include stream algorithms that reach Asio sockets. A message-only application does not need those dependencies, even though the Asio port now offers a WASIp2 socket reactor. This facade exposes data headers separately, retaining upstream type identity and parsing behaviour without a guest reactor.
The socket backend executes upstream Beast over the existing Asio port. Host
adapters map operations to browser WebSocket/fetch and wasi:http, preserving
application-visible messages with documented differences in connection ownership,
headers, framing and TLS. A host HTTP handler does not imply a TCP acceptor.
For a server counterpart, keep the application’s HTTP request processing and replace its accept loop with the host handler entry. For a local-stream counterpart, explicitly supply the two stream directions; stdin and stdout do not provide Unix socket names, descriptor passing or peer credentials.
Browser security remains the browser’s: CORS, forbidden request headers, certificate validation, redirects and WebSocket control frames cannot be implemented as arbitrary raw-socket options. Host TLS never uses guest OpenSSL settings. Prefer explicit errors to silently claiming that the host accepted an unavailable setting.
The WASI WebSocket allocator constructor accepts the portable constructor syntax, but upstream Beast still controls its internal stream-state allocation. Native uses the actual Boost stream and its original constructors. Associated completion-handler allocators retain upstream semantics. Data containers use their upstream allocator template parameters.
The shipped Wasm engine corrects an upstream noexcept on the internal variant
used by HTTP chunk serialization. With exceptions enabled, failure to allocate a
chunk header propagates std::bad_alloc; without exceptions, allocation failure
is not recoverable. Native retains the actual Boost 1.92 implementation, which
terminates on that particular allocation failure. Error-code overloads do not
turn allocation exceptions into protocol error codes. The browser regression
injects the failure through the public HTTP serializer and verifies both the
exception and the successful serialization controls.
set_server_name configures SNI only. It copies a non-terminated string view into a
bounded buffer and rejects empty, overlong or embedded-NUL hostnames. Certificate and
hostname verification remain separate TLS settings. Guest OpenSSL settings must never
be represented as changing browser or WASI host trust policy.
Feature matrix
Capabilities belong to a backend, not only a compiler target. The runtime record below and the application matrix state which variants were actually exercised. An application counterpart preserves a stated use case; it does not imply every API or transport detail of the original program is available.
| Feature | Native | WASIp2 | WASIp3 | Emscripten |
|---|---|---|---|---|
HTTP message/parser/serializer interfaces |
Implemented |
Implemented |
Implemented |
Implemented |
Guest HTTP/WebSocket socket engine |
Asio sockets |
Asio pollable socket backend; see the dated application matrix |
Asio socket port |
Explicit supplied byte stream only |
Browser WebSocket and fetch |
Not applicable |
Not applicable |
Not applicable |
JSPI and Asyncify |
Guest TLS, identity verification and shutdown |
Source-built OpenSSL |
Source-built OpenSSL |
Source-built OpenSSL |
Browser owns TLS |
Host HTTP entry/client |
Not applicable |
wasi:http |
wasi:http |
fetch client only |
Unix socket namespace and peer identity |
Operating-system sockets |
Unavailable |
Unavailable |
Unavailable |
Explicit supplied-stream counterpart |
Borrowed descriptors |
CLI input/output; asynchronous WebSocket via pollables |
CLI input/output |
Caller-supplied channel |
Raw TCP HTTP/WebSocket listener |
Available |
Available with network grants |
Available |
Unavailable |
Host HTTP WebSocket upgrade |
Not applicable |
Not provided by host adapter |
Use guest socket backend |
Browser WebSocket client only |
Native CPU-parallel threads |
Available |
Unavailable |
Cooperative WASI threads only |
Not implied by this backend |
Exception and thread variants are reported separately in the verification record. Emscripten data tests run under Node; transport tests run in the pinned Chrome. Cooperative WASIp3 threads are not CPU-parallel threads, and their SDK 34 runtime currently requires exceptions off.
Browser settings and observable differences
This table describes the browser-owned WebSocket and fetch backends. It does not
change native or WASIp3 guest socket semantics. ERROR rejects an unsupported
setting with operation_not_supported when the dependent operation starts.
IGNORE discards that setting; it does not add a missing browser capability or
disable browser security. Configuration is part of the browser types’ namespace;
translation units using different policies cannot exchange those types silently.
The browser-owned WebSocket’s websocket::request_type uses
http::basic_fields<std::pmr::polymorphic_allocator<char>>. Its handshake fields
therefore use the stream’s memory resource, including long decorator values.
Use that alias, or a generic callable, when declaring a request decorator rather
than requiring Boost’s default field allocator. Native and WASIp3 socket streams
retain the upstream request type. The explicit guest WebSocket adapter accepts
typed WebCPP request and response decorators for client and server handshakes;
it converts their fields when calling the upstream protocol implementation.
The test harness configures an ephemeral CA in a disposable full-Chrome profile.
The protocol contract peer’s certificate covers localhost and 127.0.0.1;
an untrusted profile rejects its WSS connection before the trusted contracts run.
Application HTTPS fixtures use a separate localhost-only certificate to prove
that a trusted certificate is still rejected for the wrong hostname. These
fixture settings belong to the host harness and do not add guest TLS controls.
| Setting or operation | Outcome | Meaning for the application |
|---|---|---|
SNI and |
Accepted |
The browser performs its own certificate and hostname validation. |
|
Accepted |
The browser chooses its enabled protocol versions and trust store. |
Fixed TLS version, |
Unsupported |
The application cannot change browser TLS validation or negotiation. |
Client certificate/key, additional roots, verification path or file |
Unsupported |
Guest certificate material does not configure the browser’s TLS stack. |
SNI, verification hostname or handshake Host differing from the URL authority |
Unsupported |
The browser connects and authenticates the URL authority. |
WebSocket decorator’s |
Accepted |
Its values become the browser constructor’s subprotocol list. |
Other WebSocket decorator fields, including |
Unsupported |
The browser constructs the handshake headers. |
|
Accepted |
An expired operation returns |
Idle timeout without keep-alive pings |
Accepted |
Visible messages and closure determine activity; incoming ping frames are hidden. |
Idle timeout with keep-alive pings; explicit ping and pong |
Unsupported |
The browser cannot send application-requested control frames. |
|
Close notifications only |
Ping and pong frames are not exposed by the browser API. |
|
Ignored under both policies |
The browser controls compression and frame boundaries. |
Close code 1000 or 3000 through 4999 |
Accepted |
The reason uses Beast’s bounded UTF-8 reason string. |
Other close codes, including 1001 |
Unsupported |
Under |
|
Enforced |
An oversized message reports |
|
Enforced |
Queued receives and browser-buffered sends have separate bounds. Exceeding
one closes the connection with |
HTTP Host equal to URL host or host:port |
Accepted |
The browser generates the corresponding Host field. |
HTTP |
Message framing accepted |
The adapter sends decoded body bytes; fetch chooses wire framing. |
HTTP |
Ignored under both policies |
Connection ownership and reuse belong to the browser. |
HTTP |
Unsupported |
The browser may reject, replace or omit these headers. |
HTTP methods or bodies fetch cannot send, including CONNECT |
Unsupported |
|
Redirected HTTP response |
Policy dependent |
|
CORS rejection, mixed-content rejection or another fetch failure |
|
The browser does not reliably expose a more specific cause. |
Browser socket facade’s shutdown, close and cancel |
Facade lifecycle operations |
These stop pending facade work; they do not expose a TCP descriptor. |
A successful WebSocket write means the browser accepted the message, not that the peer received it. Partial writes are accumulated into one message, and their bytes count toward the send bound. A cancelled read leaves the next message available to a later read. Destruction aborts pending operations through posted completion and unregisters event callbacks before late events can reach them. Both queue bounds default to 4 MiB. The default maximum WebSocket message is 16 MiB; a smaller receive-queue bound still applies independently. The receive bound charges each retained payload and its message record, including empty messages. Partial reads release that charge only when the complete message is consumed and its storage is released. Container bookkeeping and allocator overhead are additional implementation costs; the bound is not a total heap quota.
The default HTTP path maps messages directly to fetch. Its response body limit
defaults to 8 MiB. http::async_read_header and http::read_header accept response
messages and complete when metadata is available, before the body is consumed;
a subsequent full read consumes the body. The separate
http_byte_stream compatibility adapter synthesizes HTTP/1.1 bytes for programs
using Beast parsers, buffering the full fetch response before parsing. Fetch has
already decoded the response body, so synthetic
responses omit original Content-Encoding and Content-Length; responses with
a body use chunked framing. HEAD, 204 and 304 responses have no synthetic body
or chunk terminator. HEAD parser users retain skip(true). These representation
differences do not imply byte-for-byte equality with the original wire response.
Cancellation of host-supplied streams
The WASIp2 WebSocket counterparts use Asio’s pollable-driven CLI adapter and retain asynchronous read/write operations. Their actual client/server exchanges pass with both exception profiles. The P2 Asio supplied-stream lane checks a pending read with open, empty input, timer cancellation, cancellation slots, stream destruction, deferred initiation and handler allocator/executor associations. Other supplied counterparts retain their explicit synchronous partial operations.
Supplied-stream cancellation is checked between host calls and while waiting on
supported readiness operations. It cannot preempt a host import that blocks the
calling thread. In the tested Wasmtime 50 CLI, WASIp2 stdout can block when its
operating-system pipe fills even after check-write grants permission. A paused
consumer must resume draining before that import returns and the component can
observe cancellation. Keep the consumer draining or select a host/channel with
nonblocking write behaviour when a strict cancellation deadline is required.
This is separate from a guest socket’s cancellation semantics. Standard input and output also do not acquire Unix socket addressing or peer credentials merely because they are exposed through file descriptors.
Verification and reproduction
The Application profile evidence contains the current application refresh for the shipped implementation, including separate browser page/worker and single/multi profiles. The dated contract-test record below remains historical evidence; it must not be read as a fresh run of the unsubmitted migration or as performance data.
The shared Release comparison also measures Beast HTTP response parsing inside matched Asio/Cobalt workloads. That in-memory parser workload measures neither transport latency nor TLS throughput. It must not be presented as a network performance comparison.
The local evidence below was collected on macOS ARM64 on 2026-11-02 and 2026-11-03 with Boost
1.92, native Clang 21, wasi-sdk 34, Emscripten 6.0.11 and Wasmtime 50.0.1.
Core and guest TLS runs use Release builds. Browser contract runs use Debug,
and the standalone upstream oracle compiles with -O0; these are correctness
checks, not performance or binary-size measurements. A local pass does not
establish Windows or Linux coverage; the remote CI report supplies those
independent results.
| Suite | Profiles exercised | What passed |
|---|---|---|
Portable core and socket facade |
Native single/multi, exceptions on/off; WASIp2/P3 single, exceptions on/off; Emscripten single, exceptions on/off |
Public-header compilation, upstream type identity, binary HTTP bodies, parser limits, error policy, constructor conversion and applicable socket/SNI exchanges. |
Guest TLS protocol |
Native single/multi, exceptions on/off; WASIp3 single, exceptions on/off; WASIp3 cooperative, exceptions off |
Eight scenarios with TLS 1.2 and again with TLS 1.3 in each profile: 112 scenario executions. HTTP and binary WebSocket transfer, normal close, wrong hostname, untrusted CA, cancelled body read, truncated TLS shutdown, cancelled shutdown and handshake timeout. |
Browser and Node contract, plus browser tutorial |
JSPI/Asyncify, exceptions on/off, ERROR/IGNORE |
Real Chrome and Node 26 WebSocket/fetch exchanges, queue and body limits, timeout, cancellation, destruction, allocator alignment, reconnection and response reuse. Direct header reads complete while the server still withholds the body. The allocation counter distinguishes stream, handler and context resources and requires zero escaped global allocations and zero retained blocks after cleanup. |
WASI host HTTP and supplied streams |
WASIp2/P3 single, exceptions on/off; applicable WASIp3 cooperative tests |
Bounded 256 KiB exchanges, request/response trailers, malformed requests, resource cleanup, cancellation and explicit CLI stream counterparts. |
WASI host HTTPS |
WASIp2/P3 single, exceptions on/off; WASIp3 cooperative, exceptions off |
Six application counterparts and the shared sync/async body-and-trailer contract: 35 driver executions containing 125 TLS attempts. Trusted localhost succeeds; unknown CA and trusted wrong hostname fail. The documentation SSL client also proves mutual TLS and rejection without a client identity. |
Upstream application inventory |
Per-application and per-profile results below |
All 53 executable definitions are cross-checked against upstream Jamfiles, CMake definitions and entry points. Source hashes protect the original corpus. |
The TLS fixture synchronizes shutdown cancellation with the peer receiving
close_notify; it does not rely on an arbitrary sleep or callback ordering.
WebSocket close already tears down TLS and TCP, so its test verifies that result
without starting a second TLS shutdown. Each protocol scenario has an outer
five-second deadline, and the driver also bounds the whole process.
Guest-socket applications compile their Wasm component once with Wasmtime before the execution deadlines start. Compilation has a separate 60-second limit and records its command, duration and exit status. The driver runs only the artifact it produced in its private temporary directory, with matching engine features and epoch interruption enabled. Guest readiness retains its 15-second bound and protocol I/O retains its five-second bound. The WASIp3 driven-test envelope is 90 seconds: the compilation allowance plus the existing 30-second driver bound. Compilation failures report stdout and stderr without starting the guest.
The native WebSocket constructor regression checks same-type move and conversion
from a concrete executor to any_io_executor, including deflateSupported=false.
The configuration tests include a deliberately failing cross-translation-unit
link with different browser policies and a matching-policy success control.
An expected compile/link failure is a passing negative test only when B2 reports
failed-as-expected and its success control also passes.
The local closure regression on 2026-11-07 additionally exercises the public HTTP
serializer in real Chrome with JSPI and Asyncify. With exceptions enabled, a
forced chunk-header allocation failure must reach the caller as std::bad_alloc,
not abort. A fixed-length body and successful chunked serialization are controls.
The builds without exceptions exercise successful serialization only; they do
not claim recovery from exhausted memory. The native Boost 1.92 reproduction
retains the upstream termination behavior described in Explanation: separate messages from transport.
Reproduce a suite
Configure the project’s pinned SDKs and native Boost 1.92 in a B2 user config.
Select Wasmtime 50.0.1 explicitly through PATH. Emscripten 6 requires Python
3.10 or newer; set EMSDK_PYTHON when the system’s default Python is older.
The commands assume .local/user-config.jam and run from the superproject root.
-a forces compilation and execution; separate build directories preserve logs
and outputs across targets.
unset CPATH CPLUS_INCLUDE_PATH C_INCLUDE_PATH
b2 --user-config=.local/user-config.jam -a variant=release \
exception-handling=on,off threading=single,multi \
libs/beast/test libs/beast/example libs/beast/test/tls//tls
b2 --user-config=.local/user-config.jam -a toolset=clang-wasip2 \
variant=release exception-handling=on,off testing.launcher=wasmtime \
libs/beast/test libs/beast/example libs/beast/test/wasi//http
b2 --user-config=.local/user-config.jam -a toolset=clang-wasip3 \
variant=release exception-handling=on,off \
testing.launcher=tools/boost/asio-wasip3/run.sh \
libs/beast/test libs/beast/example libs/beast/test/tls//tls
b2 --user-config=.local/user-config.jam -a toolset=clang-wasip3 \
variant=release threading=multi exception-handling=off \
testing.launcher=tools/boost/asio-wasip3/run.sh \
libs/beast/test libs/beast/example libs/beast/test/tls//tls
b2 --user-config=.local/user-config.jam \
libs/beast/test/browser/peer//native_peer-program threading=multi
b2 --user-config=.local/user-config.jam -a toolset=emscripten \
variant=release exception-handling=on,off \
libs/beast/test/browser//browser libs/beast/example/browser//browser
The native peer built above is shared by the browser and Node contract suites. Run the Node contracts separately:
b2 --user-config=.local/user-config.jam -a toolset=emscripten \
exception-handling=on,off libs/beast/test/browser//browser-node
Repeat both contract commands with webcpp-beast-unsupported=ignore to exercise the
second policy. The browser lane installs and runs pinned full Chrome. The Node lane
executes the same Wasm programs in Node 26, using its WebSocket and fetch APIs;
it does not replace the separate browser CORS and mixed-content checks.
Host HTTP drivers start
Wasmtime with a loopback listener and bounded request transcripts. Production
network capabilities remain the embedding application’s responsibility.
HTTPS/WSS fixtures use temporary CAs. The protocol contract peer has a leaf
valid for both localhost and 127.0.0.1, preserving its existing loopback
request URLs. Its fresh untrusted Chrome profile must reject WSS with an
authority error before the trusted contract exchange runs. The application
fixture uses a separate leaf valid only for localhost; its trusted profile
must reject that certificate when addressed as 127.0.0.1.
Full Chrome receives each CA in a disposable profile, and Node receives the
contract CA through NODE_EXTRA_CA_CERTS. The system trust store is unchanged,
and neither fixture disables certificate verification. Production browser
trust remains browser-owned.
The WASI HTTPS fixture embeds exactly Wasmtime 50.0.1 and supplies a private test root through its supported host hook. Rustls performs normal chain and hostname verification. This isolates the CA from the machine and avoids claiming that a guest OpenSSL test establishes host HTTPS behavior. The stock Wasmtime CLI uses its own public roots and does not expose a custom-CA command-line option.
cargo +1.97.1 build --locked \
--manifest-path libs/beast/test/applications/host-tls/Cargo.toml \
--target-dir .local/beast-host-tls
export WEBCPP_WASI_TLS_FIXTURE="$PWD/.local/beast-host-tls/debug/webcpp-beast-host-tls-fixture"
b2 --user-config=.local/user-config.jam \
toolset=clang-wasip2,clang-wasip3 exception-handling=on,off \
libs/beast/test/applications/host-tls//applications-host-tls
The 53 upstream applications and their adaptations have separate targets. Their matrix records compilation and execution separately, including unavailable programming models rather than selecting an empty fallback program. In particular, stackful Boost.Context coroutines, native threads and asynchronous DNS are not inferred from a successful C++20 coroutine or pre-resolved-address counterpart.
Application profile evidence
All 53 upstream executables remain in every profile. Each cell gives the compile/run result independently. P = measured pass, F = measured failure, B = blocked, U = unavailable, N = no measured result.
A passing counterpart preserves the measured application operations. It does not establish unchanged source, scheduling, DNS, TLS policy or failure semantics. Native oracle comparison covers payloads/status/modes, excluding fixture addresses and elapsed time. Local native measurements use macOS ARM64; other operating systems require their CI runs. Raw results and commands are retained by the drivers.
| Profile | Configuration |
|---|---|
P01 |
|
P02 |
|
P03 |
|
P04 |
|
P05 |
|
P06 |
|
P07 |
|
P08 |
|
P09 |
|
P10 |
|
P11 |
|
P12 |
|
P13 |
|
P14 |
|
P15 |
|
P16 |
|
P17 |
|
P18 |
|
P19 |
|
P20 |
|
P21 |
|
P22 |
|
P23 |
|
P24 |
|
P25 |
|
P26 |
|
P27 |
|
P28 |
|
P29 |
|
P30 |
|
P31 |
|
P32 |
|
P33 |
|
P34 |
|
P35 |
|
| Application | P01 C/R | P02 C/R | P03 C/R | P04 C/R | P05 C/R | P06 C/R |
|---|---|---|---|---|---|---|
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
U/U |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
B/B |
B/B |
|
P/P |
P/P |
P/P |
B/B |
B/B |
B/B |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
U/U |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
B/B |
B/B |
|
P/P |
P/P |
P/P |
B/B |
B/B |
B/B |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
U/U |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
B/B |
B/B |
|
P/P |
P/P |
P/P |
B/B |
B/B |
B/B |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
U/U |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
B/B |
B/B |
|
P/P |
P/P |
P/P |
B/B |
B/B |
B/B |
|
P/P |
P/P |
P/P |
B/B |
B/B |
B/B |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
| Application | P07 C/R | P08 C/R | P09 C/R | P10 C/R | P11 C/R | P12 C/R |
|---|---|---|---|---|---|---|
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
U/U |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
U/U |
U/U |
U/U |
B/B |
U/U |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
B/B |
B/B |
B/B |
B/B |
B/B |
P/P |
|
B/B |
B/B |
B/B |
B/B |
B/B |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
U/U |
U/U |
U/U |
B/B |
U/U |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
B/B |
B/B |
B/B |
B/B |
B/B |
P/P |
|
B/B |
B/B |
B/B |
B/B |
B/B |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
P/P |
|
P/P |
P/P |
P/P |
B/B |
P/P |
U/U |
|
U/U |
U/U |
U/U |
B/B |
U/U |
U/U |
|
P/P |
P/P |
P/P |
B/B |
P/P |
U/U |
|
P/P |
P/P |
P/P |
B/B |
P/P |
U/U |
|
P/P |
P/P |
P/P |
B/B |
P/P |
U/U |
|
B/B |
B/B |
B/B |
B/B |
B/B |
U/U |
|
B/B |
B/B |
B/B |
B/B |
B/B |
U/U |
|
P/P |
P/P |
P/P |
B/B |
P/P |
U/U |
|
P/P |
P/P |
P/P |
B/B |
P/P |
U/U |
|
P/P |
P/P |
P/P |
B/B |
P/P |
U/U |
|
U/U |
U/U |
U/U |
B/B |
U/U |
U/U |
|
P/P |
P/P |
P/P |
B/B |
P/P |
U/U |
|
P/P |
P/P |
P/P |
B/B |
P/P |
U/U |
|
P/P |
P/P |
P/P |
B/B |
P/P |
U/U |
|
B/B |
B/B |
B/B |
B/B |
B/B |
U/U |
|
B/B |
B/B |
B/B |
B/B |
B/B |
U/U |
|
B/B |
B/B |
B/B |
B/B |
B/B |
U/U |
|
P/P |
P/P |
P/P |
B/B |
P/P |
U/U |
|
P/P |
P/P |
P/P |
B/B |
P/P |
U/U |
|
P/P |
P/P |
P/P |
B/B |
P/P |
U/U |
|
P/P |
P/P |
P/P |
B/B |
P/P |
U/U |
| Application | P13 C/R | P14 C/R | P15 C/R | P16 C/R | P17 C/R | P18 C/R |
|---|---|---|---|---|---|---|
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
P/P |
P/P |
P/P |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
P/P |
P/P |
P/P |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
| Application | P19 C/R | P20 C/R | P21 C/R | P22 C/R | P23 C/R | P24 C/R |
|---|---|---|---|---|---|---|
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
B/B |
B/B |
B/B |
B/B |
B/B |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
B/B |
B/B |
B/B |
B/B |
B/B |
|
U/U |
B/B |
B/B |
B/B |
B/B |
B/B |
|
U/U |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
P/P |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
B/B |
B/B |
B/B |
B/B |
B/B |
|
U/U |
B/B |
B/B |
B/B |
B/B |
B/B |
|
U/U |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
P/P |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
| Application | P25 C/R | P26 C/R | P27 C/R | P28 C/R | P29 C/R | P30 C/R |
|---|---|---|---|---|---|---|
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
B/B |
B/B |
B/B |
B/B |
B/B |
B/B |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
B/B |
B/B |
B/B |
B/B |
B/B |
B/B |
|
B/B |
B/B |
B/B |
B/B |
B/B |
B/B |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
B/B |
B/B |
B/B |
B/B |
B/B |
B/B |
|
B/B |
B/B |
B/B |
B/B |
B/B |
B/B |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
U/U |
| Application | P31 C/R | P32 C/R | P33 C/R | P34 C/R | P35 C/R |
|---|---|---|---|---|---|
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
B/B |
B/B |
B/B |
B/B |
B/B |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
|
B/B |
B/B |
B/B |
B/B |
B/B |
|
B/B |
B/B |
B/B |
B/B |
B/B |
|
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
|
B/B |
B/B |
B/B |
B/B |
B/B |
|
B/B |
B/B |
B/B |
B/B |
B/B |
|
P/P |
P/P |
P/P |
P/P |
P/P |
|
P/P |
P/P |
P/P |
P/P |
P/P |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
|
U/U |
U/U |
U/U |
U/U |
U/U |
Adaptations and limits
-
WASIp2/P3 socket counterparts use a fixture resolver posting the known local endpoint. DNS worker threads remain unverified. Worker/system executors use an explicit event loop.
-
Host HTTP preserves file handlers or request/body operations. Host listeners, framing and TLS are distinct from guest sockets. Six HTTPS client counterparts run through a configured Wasmtime host with an isolated CA, rejecting unknown issuers and trusted certificates for the wrong hostname. The documentation client additionally measures host-owned mutual TLS and missing-identity rejection. The documentation server measures a host mutual-TLS frontend.
-
The host crawler retains upstream report aggregation and two asynchronous workers over bounded authority/path inputs. Its fixture uses two peers, six paths, four response statuses, and a truncated-response failure followed by continued work. Host HTTP combines transport phases: failures count as Read; separate DNS/connect/write/timer phase counts are unmeasured.
-
Supplied streams replace Unix-domain addressing with caller-provided stdio. P2 WebSocket counterparts retain asynchronous partial operations through Asio pollables; the other supplied counterparts use synchronous partial operations.
-
Browser fetch/WebSocket own DNS, framing and TLS. Guest CA lists, protocol pinning and handshake User-Agent are removed explicitly. HTTPS fixtures install an ephemeral CA in an isolated Chrome profile. A fresh untrusted profile rejects the certificate; the trusted profile rejects its incorrect IP hostname. No certificate-error bypass or system trust-store modification is used.
-
Exception-off counterparts retain error-code paths and successful operations; formerly throwing paths report failure and abort. Stackful Context remains blocked.
-
P2 socket and guest-TLS cells require their own measured application results. Browser listeners and WASI Unix-domain socket addressing remain unavailable. WASIp3 cooperative EH-on lacks the toolchain exception runtime.
Reproduction
python3 libs/beast/test/applications/inventory.py --check
python3 libs/beast/example/applications/tools/prepare.py --clang-format clang-format
b2 libs/beast/test/applications//applications
b2 toolset=clang-wasip3 libs/beast/test/applications/wasip3//applications-p3
b2 toolset=emscripten libs/beast/test/applications/browser//applications-browser
b2 toolset=clang-wasip2 libs/beast/test/applications/host//applications-host
b2 toolset=clang-wasip2 libs/beast/test/applications/host-clients//applications-host-clients
cargo build --locked --manifest-path libs/beast/test/applications/host-tls/Cargo.toml --target-dir .local/host-tls
export PATH="$PWD/.local/host-tls/debug:$PATH"
b2 toolset=clang-wasip2 libs/beast/test/applications/host-tls//applications-host-tls
b2 libs/beast/test/applications/noexcept//applications-noexcept
b2 toolset=clang-wasip3 libs/beast/test/applications/noexcept//applications-single-noexcept
b2 toolset=emscripten libs/beast/test/applications/browser-noexcept//applications-browser
b2 toolset=clang-wasip3 libs/beast/test/applications/streams//applications-streams
b2 toolset=clang-wasip3 libs/beast/test/applications/streams//applications-websocket-streams
b2 libs/beast/test/applications/chat//applications-chat
Configure pinned toolchains with the standard B2 user configuration. Clear CPATH/C_INCLUDE_PATH/CPLUS_INCLUDE_PATH. Runtime peers bind loopback ports, wait for readiness, enforce deadlines, and reap every process.
Guarantees and evidence
-
message_test.cppchecks upstream type identity, embedded-NUL payloads, parser body limits and malformed fields on every declared data target. -
socket_test.cppexchanges real HTTP and binary WebSocket payloads, completes both sides of a close handshake, and verifies a stalled peer reaches the stream timeout. Each case has a five-second outer deadline. -
ssl_test.cppchecks SNI copying and rejection without replacing an existing valid name. It does not claim that an SNI setting authenticates the peer. -
config_test.cppchecks compiler/global/library exception configuration, both unsupported-operation policies and rejection of conflicting definitions. -
test/tls/protocol.cppchecks actual TLS HTTP and WebSocket exchanges, authentication failures, transfer cancellation and TLS shutdown outcomes. -
test/browser/browser_test.cppruns the browser contracts in Chrome. Its local server controls delayed headers and bodies, redirects, WebSocket closure and CORS. -
test/applications/inventory.pyverifies all 53 pinned upstream executables and their source hashes; application drivers compare explicit local exchanges.
Reference
Macros
| Name | Description |
|---|---|
Selects a protocol implementation header for internal use. |
|
1 when guest OpenSSL can be linked on the selected target; does not link it. |
|
1 when the selected Asio backend supplies native or WASI guest sockets. |
|
Records the facade’s exception policy for host-adapter implementations. |
|
Reports unsupported host operations as errors, the default policy. |
|
Reports unsupported host operations as errors, the default policy. |
|
Allows documented unsupported settings to be ignored by host adapters. |
|
Exports the P2 host server. |
webcpp::beast
Namespace Aliases
| Name | Description |
|---|---|
Upstream generic error conditions. |
Types
| Name | Description |
|---|---|
TLS intent validated before the browser owns the secure connection. |
|
A browser authority record, with Beast’s connection and deadline interface. |
Enums
| Name | Description |
|---|---|
Browser failures without a corresponding Beast or Asio error. |
Functions
| Name | Description |
|---|---|
Returns the stable browser error category. |
|
Converts a browser failure into its stable error-code representation. |
|
Records the requested TLS server name for authority validation. |
Using Declarations
| Name | Description |
|---|---|
Upstream contiguous dynamic buffer with an application-supplied allocator. |
|
Upstream segmented dynamic buffer with an application-supplied allocator. |
|
Binds leading arguments to a completion handler. |
|
Returns a view of the first bytes of a buffer sequence. |
|
Copies a buffer sequence to a string. |
|
Upstream common stream errors, including timeout. |
|
The error-code type used by Beast operations. |
|
Upstream file-opening modes for explicit file bodies. |
|
Upstream contiguous dynamic buffer. |
|
Upstream contiguous buffer with fixed capacity. |
|
Finds the innermost layer of a composed stream. |
|
Compares strings with HTTP’s ASCII case-insensitive rules. |
|
Formats a buffer sequence for diagnostic output. |
|
Upstream segmented dynamic buffer. |
|
Creates an output stream that appends to a dynamic buffer. |
|
Client or server role used by protocol options. |
|
Upstream fixed-capacity buffer. |
|
Upstream non-owning string view. |
|
Upstream exception type for explicitly throwing application code. |
webcpp::beast::browser
Types
| Name | Description |
|---|---|
Explicit synthetic HTTP/1.1 adapter for upstream parser and serializer algorithms. |
webcpp::beast::browser::http_byte_stream
Explicit synthetic HTTP/1.1 adapter for upstream parser and serializer algorithms.
Synopsis
Declared in <webcpp/beast/browser/http_byte_stream.hpp>
template</* implementation-defined */ NextLayer>
class http_byte_stream;
Description
Fetch owns real framing. This adapter decodes an outgoing serialized request and exposes a synthetic chunked response. HEAD, 204 and 304 have no body framing. The adapter and its next layer must outlive every outstanding operation.
Type Aliases
| Name | Description |
|---|---|
Executor used to schedule stream operations and their completions. |
|
Type of the layer immediately below this stream. |
Member Functions
| Name | Description |
|---|---|
|
Attaches a synthetic HTTP byte view to the supplied browser layer. |
Reads bytes from the synthetic HTTP response after fetch completes. |
|
Consumes serialized request bytes and starts fetch when the request is complete. |
|
Returns the executor used for asynchronous completions. |
|
Returns the immediately underlying layer. |
|
Reads bytes from the synthetic HTTP response after fetch completes. |
|
Consumes serialized request bytes and starts fetch when the request is complete. |
Template Parameters
| Name | Description |
|---|---|
NextLayer |
Underlying browser authority or TLS-intent layer. |
webcpp::beast::browser::http_byte_stream::executor_type
Executor used to schedule stream operations and their completions.
Synopsis
Declared in <webcpp/beast/browser/http_byte_stream.hpp>
using executor_type = NextLayer::executor_type;
webcpp::beast::browser::http_byte_stream::next_layer_type
Type of the layer immediately below this stream.
webcpp::beast::browser::http_byte_stream::http_byte_stream
Attaches a synthetic HTTP byte view to the supplied browser layer.
Synopsis
Declared in <webcpp/beast/browser/http_byte_stream.hpp>
explicit
http_byte_stream(NextLayer& next);
Parameters
| Name | Description |
|---|---|
next |
Underlying layer that must outlive this adapter and its operations. |
webcpp::beast::browser::http_byte_stream::async_read_some
Reads bytes from the synthetic HTTP response after fetch completes.
Synopsis
Declared in <webcpp/beast/browser/http_byte_stream.hpp>
template<
class Buffers,
class Token>
auto
async_read_some(
Buffers const& buffers,
Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code, std::size_t).
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Buffers |
MutableBufferSequence receiving response or message bytes. |
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
buffers |
Buffer sequence whose storage remains valid until completion. |
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::browser::http_byte_stream::async_write_some
Consumes serialized request bytes and starts fetch when the request is complete.
Synopsis
Declared in <webcpp/beast/browser/http_byte_stream.hpp>
template<
class Buffers,
class Token>
auto
async_write_some(
Buffers const& buffers,
Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code, std::size_t).
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Buffers |
ConstBufferSequence providing request or message bytes. |
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
buffers |
Buffer sequence whose storage remains valid until completion. |
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::browser::http_byte_stream::get_executor
Returns the executor used for asynchronous completions.
Synopsis
Declared in <webcpp/beast/browser/http_byte_stream.hpp>
[[nodiscard]]
executor_type
get_executor() const;
Return Value
The executor associated with the underlying context.
|
Note
|
The return value should not be discarded. |
webcpp::beast::browser::http_byte_stream::next_layer
Returns the immediately underlying layer.
Return Value
A reference to the underlying stream.
webcpp::beast::browser::http_byte_stream::read_some
Reads bytes from the synthetic HTTP response after fetch completes.
Synopses
Declared in <webcpp/beast/browser/http_byte_stream.hpp>
Reads bytes from the synthetic HTTP response after fetch completes.
template<class Buffers>
std::size_t
read_some(Buffers const& buffers);
Reads bytes from the synthetic HTTP response after fetch completes.
template<class Buffers>
std::size_t
read_some(
Buffers const& buffers,
boost::system::error_code& ec);
Return Value
The number of bytes delivered to the destination.
Template Parameters
| Name | Description |
|---|---|
Buffers |
MutableBufferSequence receiving response or message bytes. |
Parameters
| Name | Description |
|---|---|
buffers |
Buffer sequence whose storage remains valid until completion. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::browser::http_byte_stream::read_some
Reads bytes from the synthetic HTTP response after fetch completes.
Synopsis
Declared in <webcpp/beast/browser/http_byte_stream.hpp>
template<class Buffers>
std::size_t
read_some(Buffers const& buffers);
Return Value
The number of bytes delivered to the destination.
Template Parameters
| Name | Description |
|---|---|
Buffers |
MutableBufferSequence receiving response or message bytes. |
Parameters
| Name | Description |
|---|---|
buffers |
Buffer sequence whose storage remains valid until completion. |
webcpp::beast::browser::http_byte_stream::read_some
Reads bytes from the synthetic HTTP response after fetch completes.
Synopsis
Declared in <webcpp/beast/browser/http_byte_stream.hpp>
template<class Buffers>
std::size_t
read_some(
Buffers const& buffers,
boost::system::error_code& ec);
Return Value
The number of bytes delivered to the destination.
Template Parameters
| Name | Description |
|---|---|
Buffers |
MutableBufferSequence receiving response or message bytes. |
Parameters
| Name | Description |
|---|---|
buffers |
Buffer sequence whose storage remains valid until completion. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::browser::http_byte_stream::write_some
Consumes serialized request bytes and starts fetch when the request is complete.
Synopses
Declared in <webcpp/beast/browser/http_byte_stream.hpp>
Consumes serialized request bytes and starts fetch when the request is complete.
template<class Buffers>
std::size_t
write_some(Buffers const& buffers);
Consumes serialized request bytes and starts fetch when the request is complete.
template<class Buffers>
std::size_t
write_some(
Buffers const& buffers,
boost::system::error_code& ec);
Return Value
The number of input bytes accepted, or zero on failure.
Template Parameters
| Name | Description |
|---|---|
Buffers |
ConstBufferSequence providing request or message bytes. |
Parameters
| Name | Description |
|---|---|
buffers |
Buffer sequence whose storage remains valid until completion. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::browser::http_byte_stream::write_some
Consumes serialized request bytes and starts fetch when the request is complete.
Synopsis
Declared in <webcpp/beast/browser/http_byte_stream.hpp>
template<class Buffers>
std::size_t
write_some(Buffers const& buffers);
Return Value
The number of input bytes accepted, or zero on failure.
Template Parameters
| Name | Description |
|---|---|
Buffers |
ConstBufferSequence providing request or message bytes. |
Parameters
| Name | Description |
|---|---|
buffers |
Buffer sequence whose storage remains valid until completion. |
webcpp::beast::browser::http_byte_stream::write_some
Consumes serialized request bytes and starts fetch when the request is complete.
Synopsis
Declared in <webcpp/beast/browser/http_byte_stream.hpp>
template<class Buffers>
std::size_t
write_some(
Buffers const& buffers,
boost::system::error_code& ec);
Return Value
The number of input bytes accepted, or zero on failure.
Template Parameters
| Name | Description |
|---|---|
Buffers |
ConstBufferSequence providing request or message bytes. |
Parameters
| Name | Description |
|---|---|
buffers |
Buffer sequence whose storage remains valid until completion. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::http
Functions
| Name | Description |
|---|---|
Receives the complete decoded fetch response into a Beast message. |
|
Receives response metadata before fetch has consumed its body. |
|
Submits one complete request to fetch after validating browser restrictions. |
|
Receives the complete decoded fetch response into a Beast message. |
|
|
|
Submits one complete request to fetch after validating browser restrictions. |
Using Declarations
| Name | Description |
|---|---|
Upstream HTTP async read operation on a byte stream. |
|
Upstream HTTP async read header operation on a byte stream. |
|
Upstream HTTP async read some operation on a byte stream. |
|
Upstream HTTP async write operation on a byte stream. |
|
Upstream HTTP async write header operation on a byte stream. |
|
Upstream HTTP async write some operation on a byte stream. |
|
Upstream body backed by a selected dynamic buffer type. |
|
Upstream HTTP fields with an application-supplied allocator. |
|
Upstream string body with an application-supplied allocator. |
|
Upstream body that reads or writes caller-owned buffers. |
|
Upstream dynamically buffered body. |
|
Upstream body for messages without a payload. |
|
Upstream HTTP parser and serializer errors. |
|
Upstream HTTP field names. |
|
Upstream HTTP fields. |
|
Upstream file-backed message body. |
|
Upstream request or response header. |
|
Upstream HTTP request or response message. |
|
Returns the conventional reason phrase for a status code. |
|
Upstream incremental message parser. |
|
Upstream HTTP read operation on a byte stream. |
|
Upstream HTTP read header operation on a byte stream. |
|
Upstream HTTP read some operation on a byte stream. |
|
Upstream HTTP request. |
|
Upstream HTTP request header. |
|
Upstream incremental request parser. |
|
Upstream incremental request serializer. |
|
Upstream HTTP response. |
|
Upstream HTTP response header. |
|
Upstream incremental response parser. |
|
Upstream incremental response serializer. |
|
Upstream incremental message serializer. |
|
Upstream HTTP status codes. |
|
Upstream string message body. |
|
Parses a method name while preserving upstream method semantics. |
|
Upstream HTTP methods. |
|
Upstream HTTP write operation on a byte stream. |
|
Upstream HTTP write header operation on a byte stream. |
|
Upstream HTTP write some operation on a byte stream. |
webcpp::beast::http::async_read
Receives the complete decoded fetch response into a Beast message.
Synopsis
Declared in <webcpp/beast/browser/http.hpp>
template<
/* implementation-defined */ Stream,
class Buffer,
class Body,
class Allocator,
class Token>
auto
async_read(
Stream& stream,
Buffer&,
webcpp::beast_backend::http::response<Body, webcpp::beast_backend::http::basic_fields<Allocator>>& response,
Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code, std::size_t). Fetch decoding precedes message delivery, and wire framing headers are normalized. The authority record response_body_limit bounds the decoded body before allocation.
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Stream |
Browser authority record or TLS-intent stream. |
Buffer |
Dynamic buffer type retained for Beast call compatibility. |
Body |
Beast body model used to encode or receive the message body. |
Allocator |
Allocator used by the HTTP message fields. |
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
stream |
Browser stream whose recorded authority selects the host operation. |
response |
Destination message, kept alive until asynchronous completion when applicable. |
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::http::async_read_header
Receives response metadata before fetch has consumed its body.
Synopsis
Declared in <webcpp/beast/browser/http.hpp>
template<
/* implementation-defined */ Stream,
class Buffer,
class Body,
class Allocator,
class Token>
auto
async_read_header(
Stream& stream,
Buffer&,
webcpp::beast_backend::http::response<Body, webcpp::beast_backend::http::basic_fields<Allocator>>& response,
Token&& token);
Description
The next complete read consumes the retained response body; a metadata read leaves it untouched. The buffer parameter is retained for Beast call compatibility and receives no wire bytes.
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Stream |
Browser authority or TLS-intent stream. |
Buffer |
Dynamic buffer type accepted for call compatibility. |
Body |
Beast body model of the destination response. |
Allocator |
Allocator of the destination fields. |
Token |
Completion token for void(error_code, std::size_t). |
Parameters
| Name | Description |
|---|---|
stream |
Stream with an outstanding fetch request. |
response |
Destination for status and exposed fields; kept alive until completion. |
token |
Completion token determining the operation result type. |
webcpp::beast::http::async_write
Submits one complete request to fetch after validating browser restrictions.
Synopsis
Declared in <webcpp/beast/browser/http.hpp>
template<
/* implementation-defined */ Stream,
class Body,
class Allocator,
class Token>
auto
async_write(
Stream& stream,
webcpp::beast_backend::http::request<Body, webcpp::beast_backend::http::basic_fields<Allocator>>& request,
Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code, std::size_t).
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Stream |
Browser authority record or TLS-intent stream. |
Body |
Beast body model used to encode or receive the message body. |
Allocator |
Allocator used by the HTTP message fields. |
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
stream |
Browser stream whose recorded authority selects the host operation. |
request |
Complete request, kept alive until asynchronous completion when applicable. |
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::http::read
Receives the complete decoded fetch response into a Beast message.
Synopses
Declared in <webcpp/beast/browser/http.hpp>
Receives the complete decoded fetch response into a Beast message.
template<
/* implementation-defined */ Stream,
class Buffer,
class Body,
class Allocator>
std::size_t
read(
Stream& stream,
Buffer& buffer,
webcpp::beast_backend::http::response<Body, webcpp::beast_backend::http::basic_fields<Allocator>>& response);
Receives the complete decoded fetch response into a Beast message.
template<
/* implementation-defined */ Stream,
class Buffer,
class Body,
class Allocator>
std::size_t
read(
Stream& stream,
Buffer& buffer,
webcpp::beast_backend::http::response<Body, webcpp::beast_backend::http::basic_fields<Allocator>>& response,
boost::system::error_code& ec);
Return Value
The number of decoded body bytes delivered.
Template Parameters
| Name | Description |
|---|---|
Stream |
Browser authority record or TLS-intent stream. |
Buffer |
Dynamic buffer type retained for Beast call compatibility. |
Body |
Beast body model used to encode or receive the message body. |
Allocator |
Allocator used by the HTTP message fields. |
Parameters
| Name | Description |
|---|---|
stream |
Browser stream whose recorded authority selects the host operation. |
buffer |
Compatibility buffer; direct fetch reads do not consume or append wire bytes. |
response |
Destination message, kept alive until asynchronous completion when applicable. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::http::read
Receives the complete decoded fetch response into a Beast message.
Synopsis
Declared in <webcpp/beast/browser/http.hpp>
template<
/* implementation-defined */ Stream,
class Buffer,
class Body,
class Allocator>
std::size_t
read(
Stream& stream,
Buffer& buffer,
webcpp::beast_backend::http::response<Body, webcpp::beast_backend::http::basic_fields<Allocator>>& response);
Description
Fetch decoding precedes message delivery, and wire framing headers are normalized. The authority record response_body_limit bounds the decoded body before allocation.
Return Value
The number of decoded body bytes delivered.
Template Parameters
| Name | Description |
|---|---|
Stream |
Browser authority record or TLS-intent stream. |
Buffer |
Dynamic buffer type retained for Beast call compatibility. |
Body |
Beast body model used to encode or receive the message body. |
Allocator |
Allocator used by the HTTP message fields. |
Parameters
| Name | Description |
|---|---|
stream |
Browser stream whose recorded authority selects the host operation. |
buffer |
Compatibility buffer; direct fetch reads do not consume or append wire bytes. |
response |
Destination message, kept alive until asynchronous completion when applicable. |
webcpp::beast::http::read
Receives the complete decoded fetch response into a Beast message.
Synopsis
Declared in <webcpp/beast/browser/http.hpp>
template<
/* implementation-defined */ Stream,
class Buffer,
class Body,
class Allocator>
std::size_t
read(
Stream& stream,
Buffer& buffer,
webcpp::beast_backend::http::response<Body, webcpp::beast_backend::http::basic_fields<Allocator>>& response,
boost::system::error_code& ec);
Description
Fetch decoding precedes message delivery, and wire framing headers are normalized. The authority record response_body_limit bounds the decoded body before allocation.
Return Value
The number of decoded body bytes delivered.
Template Parameters
| Name | Description |
|---|---|
Stream |
Browser authority record or TLS-intent stream. |
Buffer |
Dynamic buffer type retained for Beast call compatibility. |
Body |
Beast body model used to encode or receive the message body. |
Allocator |
Allocator used by the HTTP message fields. |
Parameters
| Name | Description |
|---|---|
stream |
Browser stream whose recorded authority selects the host operation. |
buffer |
Compatibility buffer; direct fetch reads do not consume or append wire bytes. |
response |
Destination message, kept alive until asynchronous completion when applicable. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::http::read_header
read_header overloads
Synopses
Declared in <webcpp/beast/browser/http.hpp>
Suspends until response metadata is available and throws on failure.
template<
/* implementation-defined */ Stream,
class Buffer,
class Body,
class Allocator>
std::size_t
read_header(
Stream& stream,
Buffer& buffer,
webcpp::beast_backend::http::response<Body, webcpp::beast_backend::http::basic_fields<Allocator>>& response);
Suspends the main stack until fetch exposes response metadata.
template<
/* implementation-defined */ Stream,
class Buffer,
class Body,
class Allocator>
std::size_t
read_header(
Stream& stream,
Buffer& buffer,
webcpp::beast_backend::http::response<Body, webcpp::beast_backend::http::basic_fields<Allocator>>& response,
boost::system::error_code& ec);
Return Value
The logical HTTP status-line and field byte count, excluding the body.
Template Parameters
| Name | Description |
|---|---|
Stream |
Browser authority or TLS-intent stream. |
Buffer |
Dynamic buffer type accepted for call compatibility. |
Body |
Beast body model of the destination response. |
Allocator |
Allocator of the destination fields. |
Parameters
| Name | Description |
|---|---|
stream |
Stream with an outstanding fetch request. |
buffer |
Compatibility buffer, whose contents are unchanged. |
response |
Destination for response status and exposed fields. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::http::read_header
Suspends until response metadata is available and throws on failure.
Synopsis
Declared in <webcpp/beast/browser/http.hpp>
template<
/* implementation-defined */ Stream,
class Buffer,
class Body,
class Allocator>
std::size_t
read_header(
Stream& stream,
Buffer& buffer,
webcpp::beast_backend::http::response<Body, webcpp::beast_backend::http::basic_fields<Allocator>>& response);
Return Value
The logical HTTP status-line and field byte count, excluding the body.
Template Parameters
| Name | Description |
|---|---|
Stream |
Browser authority or TLS-intent stream. |
Buffer |
Dynamic buffer type accepted for call compatibility. |
Body |
Beast body model of the destination response. |
Allocator |
Allocator of the destination fields. |
Parameters
| Name | Description |
|---|---|
stream |
Stream with an outstanding fetch request. |
buffer |
Compatibility buffer, whose contents are unchanged. |
response |
Destination for response status and exposed fields. |
webcpp::beast::http::read_header
Suspends the main stack until fetch exposes response metadata.
Synopsis
Declared in <webcpp/beast/browser/http.hpp>
template<
/* implementation-defined */ Stream,
class Buffer,
class Body,
class Allocator>
std::size_t
read_header(
Stream& stream,
Buffer& buffer,
webcpp::beast_backend::http::response<Body, webcpp::beast_backend::http::basic_fields<Allocator>>& response,
boost::system::error_code& ec);
Description
The complete body remains available to a later read, and executing handlers cannot reenter this synchronous facade.
Return Value
The logical HTTP status-line and field byte count, excluding the body.
Template Parameters
| Name | Description |
|---|---|
Stream |
Browser authority or TLS-intent stream. |
Buffer |
Dynamic buffer type accepted for call compatibility. |
Body |
Beast body model of the destination response. |
Allocator |
Allocator of the destination fields. |
Parameters
| Name | Description |
|---|---|
stream |
Stream with an outstanding fetch request. |
buffer |
Compatibility buffer, whose contents are unchanged. |
response |
Destination for response status and exposed fields. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::http::write
Submits one complete request to fetch after validating browser restrictions.
Synopses
Declared in <webcpp/beast/browser/http.hpp>
Submits one complete request to fetch after validating browser restrictions.
template<
/* implementation-defined */ Stream,
class Body,
class Allocator>
std::size_t
write(
Stream& stream,
webcpp::beast_backend::http::request<Body, webcpp::beast_backend::http::basic_fields<Allocator>>& request);
Submits one complete request to fetch after validating browser restrictions.
template<
/* implementation-defined */ Stream,
class Body,
class Allocator>
std::size_t
write(
Stream& stream,
webcpp::beast_backend::http::request<Body, webcpp::beast_backend::http::basic_fields<Allocator>>& request,
boost::system::error_code& ec);
Return Value
The accepted body and synthetic header byte count.
Template Parameters
| Name | Description |
|---|---|
Stream |
Browser authority record or TLS-intent stream. |
Body |
Beast body model used to encode or receive the message body. |
Allocator |
Allocator used by the HTTP message fields. |
Parameters
| Name | Description |
|---|---|
stream |
Browser stream whose recorded authority selects the host operation. |
request |
Complete request, kept alive until asynchronous completion when applicable. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::http::write
Submits one complete request to fetch after validating browser restrictions.
Synopsis
Declared in <webcpp/beast/browser/http.hpp>
template<
/* implementation-defined */ Stream,
class Body,
class Allocator>
std::size_t
write(
Stream& stream,
webcpp::beast_backend::http::request<Body, webcpp::beast_backend::http::basic_fields<Allocator>>& request);
Return Value
The accepted body and synthetic header byte count.
Template Parameters
| Name | Description |
|---|---|
Stream |
Browser authority record or TLS-intent stream. |
Body |
Beast body model used to encode or receive the message body. |
Allocator |
Allocator used by the HTTP message fields. |
Parameters
| Name | Description |
|---|---|
stream |
Browser stream whose recorded authority selects the host operation. |
request |
Complete request, kept alive until asynchronous completion when applicable. |
webcpp::beast::http::write
Submits one complete request to fetch after validating browser restrictions.
Synopsis
Declared in <webcpp/beast/browser/http.hpp>
template<
/* implementation-defined */ Stream,
class Body,
class Allocator>
std::size_t
write(
Stream& stream,
webcpp::beast_backend::http::request<Body, webcpp::beast_backend::http::basic_fields<Allocator>>& request,
boost::system::error_code& ec);
Return Value
The accepted body and synthetic header byte count.
Template Parameters
| Name | Description |
|---|---|
Stream |
Browser authority record or TLS-intent stream. |
Body |
Beast body model used to encode or receive the message body. |
Allocator |
Allocator used by the HTTP message fields. |
Parameters
| Name | Description |
|---|---|
stream |
Browser stream whose recorded authority selects the host operation. |
request |
Complete request, kept alive until asynchronous completion when applicable. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::http::async_read_header
Upstream HTTP async read header operation on a byte stream.
Synopsis
Declared in <webcpp/beast/http/read.hpp>
using webcpp::beast_backend::http::async_read_header;
webcpp::beast::http::async_read_some
Upstream HTTP async read some operation on a byte stream.
Synopsis
Declared in <webcpp/beast/http/read.hpp>
using webcpp::beast_backend::http::async_read_some;
webcpp::beast::http::async_write_header
Upstream HTTP async write header operation on a byte stream.
Synopsis
Declared in <webcpp/beast/http/write.hpp>
using webcpp::beast_backend::http::async_write_header;
webcpp::beast::http::async_write_some
Upstream HTTP async write some operation on a byte stream.
Synopsis
Declared in <webcpp/beast/http/write.hpp>
using webcpp::beast_backend::http::async_write_some;
webcpp::beast::http::response_serializer
Upstream incremental response serializer.
Synopsis
Declared in <webcpp/beast/http.hpp>
using webcpp::beast_backend::http::response_serializer;
webcpp::beast::http::string_to_verb
Parses a method name while preserving upstream method semantics.
webcpp::beast::wasi
Types
| Name | Description |
|---|---|
A host HTTP client. |
|
Drives bounded host readiness operations without a socket reactor or worker thread. |
|
stdin/stdout or a supplied descriptor pair, borrowed exclusively for this object’s lifetime. |
|
Cancellation and a deadline for a supplied channel; no background worker is created. |
|
A borrowed pair of nonblocking host channels. |
Functions
| Name | Description |
|---|---|
Asynchronously performs a host client exchange with bounded readiness steps. |
|
Asynchronously reads a complete host request with bounded readiness steps. |
|
Asynchronously commits and writes one host response with bounded readiness steps. |
|
Parses one message and retains overread in the caller’s buffer. |
|
Reads a complete host request into the caller’s allocator. |
|
Sends one response, returning logical body payload bytes. |
|
Serializes one message and returns actual channel bytes. |
Using Declarations
| Name | Description |
|---|---|
Explicit streaming host input, independent of a socket. |
|
Explicit streaming host output, independent of a socket. |
|
Transfer limits and cancellation shared with the host HTTP resources. |
webcpp::beast::wasi::client
A host HTTP client.
Description
The host owns DNS, connections and HTTPS trust.
Member Functions
webcpp::beast::wasi::client::client
Borrows connection metadata, which must outlive this client.
Synopsis
Declared in <webcpp/beast/wasi/http.hpp>
client(
std::string_view scheme,
std::string_view authority);
Parameters
| Name | Description |
|---|---|
scheme |
HTTP or HTTPS. |
authority |
Host and optional port. |
webcpp::beast::wasi::client::authority
Returns the borrowed request authority.
Synopsis
Declared in <webcpp/beast/wasi/http.hpp>
[[nodiscard]]
std::string_view
authority() const noexcept;
Return Value
Host and optional port, as supplied at construction.
|
Note
|
The return value should not be discarded. |
webcpp::beast::wasi::client::perform
Performs a suspending exchange, preserving the caller’s Beast body and field allocators.
Synopsis
Declared in <webcpp/beast/wasi/http.hpp>
template<
class RequestBody,
class RequestFields,
class ResponseBody,
class ResponseFields,
class Trailers = webcpp::beast_backend::http::fields>
std::size_t
perform(
http::request<RequestBody, RequestFields>& request,
http::response<ResponseBody, ResponseFields>& response,
boost::system::error_code& error,
webcpp::wasi::http::transfer_options const& options = transfer_options(),
Trailers* response_trailers = nullptr,
Trailers const* request_trailers = nullptr);
Description
The request and response may use any synchronous Beast BodyReader/BodyWriter. Returned bytes count decoded response payload only. Transfer encoding and connection ownership remain host capabilities; forbidden fields produce a visible error.
Return Value
The number of received response payload bytes.
Template Parameters
| Name | Description |
|---|---|
RequestBody |
Outgoing Beast body type. |
RequestFields |
Outgoing Beast fields type. |
ResponseBody |
Incoming Beast body type. |
ResponseFields |
Incoming Beast fields type. |
Trailers |
Trailer fields type. |
Parameters
| Name | Description |
|---|---|
request |
Outgoing application message. |
response |
Initially empty incoming message. |
error |
Receives any transfer failure. |
options |
Body limit, cancellation and deadline. |
response_trailers |
Optional received trailers. |
request_trailers |
Optional outgoing trailers. |
webcpp::beast::wasi::client::scheme
Returns the borrowed request scheme.
Synopsis
Declared in <webcpp/beast/wasi/http.hpp>
[[nodiscard]]
std::string_view
scheme() const noexcept;
Return Value
HTTP or HTTPS, as supplied at construction.
|
Note
|
The return value should not be discarded. |
webcpp::beast::wasi::http_context
Drives bounded host readiness operations without a socket reactor or worker thread.
Description
poll performs one bounded scan and never waits for data. run yields the current component task between scans. Callers keep messages and resources alive until their completion handler runs. Posted completion storage is released before invoking the handler, so its associated allocator resource may be released there. Destroying the context abandons pending handlers and cancels their host resource operations before releasing state.
Types
| Name | Description |
|---|---|
An executor that queues work on its owning host context. |
Member Functions
| Name | Description |
|---|---|
|
Constructors |
|
Cancels and releases pending operations without invoking abandoned handlers. |
|
Forbids duplicated ownership of pending operations. |
Takes ownership of an intrusive readiness operation. |
|
Returns the executor of this context. |
|
Polls each initially queued operation once without waiting for readiness. |
|
Runs until no owned operation or associated work remains. |
webcpp::beast::wasi::http_context::executor_type
An executor that queues work on its owning host context.
Member Functions
| Name | Description |
|---|---|
|
Refers to one host context. |
Returns the owning context. |
|
Queues a continuation without inline invocation. |
|
Queues dispatch work without inline invocation. |
|
Releases externally associated outstanding work. |
|
Retains externally associated outstanding work. |
|
Queues a function using the supplied allocator. |
|
Compares context identity. |
webcpp::beast::wasi::http_context::executor_type::executor_type
Refers to one host context.
Synopsis
Declared in <webcpp/beast/wasi/async.hpp>
explicit
executor_type(http_context& context) noexcept;
Parameters
| Name | Description |
|---|---|
context |
Owning execution context. |
webcpp::beast::wasi::http_context::executor_type::context
Returns the owning context.
Synopsis
Declared in <webcpp/beast/wasi/async.hpp>
[[nodiscard]]
http_context&
context() const noexcept;
webcpp::beast::wasi::http_context::executor_type::defer
Queues a continuation without inline invocation.
Synopsis
Declared in <webcpp/beast/wasi/async.hpp>
template<
class Function,
class Allocator>
void
defer(
Function&& function,
Allocator const& allocator) const;
Template Parameters
| Name | Description |
|---|---|
Function |
Nullary callable. |
Allocator |
State allocator. |
Parameters
| Name | Description |
|---|---|
function |
Work to execute. |
allocator |
Allocator for the queue node. |
webcpp::beast::wasi::http_context::executor_type::dispatch
Queues dispatch work without inline invocation.
Synopsis
Declared in <webcpp/beast/wasi/async.hpp>
template<
class Function,
class Allocator>
void
dispatch(
Function&& function,
Allocator const& allocator) const;
Template Parameters
| Name | Description |
|---|---|
Function |
Nullary callable. |
Allocator |
State allocator. |
Parameters
| Name | Description |
|---|---|
function |
Work to execute. |
allocator |
Allocator for the queue node. |
webcpp::beast::wasi::http_context::executor_type::on_work_finished
Releases externally associated outstanding work.
webcpp::beast::wasi::http_context::executor_type::on_work_started
Retains externally associated outstanding work.
webcpp::beast::wasi::http_context::executor_type::post
Queues a function using the supplied allocator.
Synopsis
Declared in <webcpp/beast/wasi/async.hpp>
template<
class Function,
class Allocator>
void
post(
Function&& function,
Allocator const& allocator) const;
Template Parameters
| Name | Description |
|---|---|
Function |
Nullary callable. |
Allocator |
State allocator. |
Parameters
| Name | Description |
|---|---|
function |
Work to execute on a subsequent poll. |
allocator |
Allocator used for the queue node. |
webcpp::beast::wasi::http_context::executor_type::operator==
Compares context identity.
Synopsis
Declared in <webcpp/beast/wasi/async.hpp>
bool
operator==(executor_type const& other) const noexcept;
Return Value
Whether the executors share a context.
Parameters
| Name | Description |
|---|---|
other |
Executor to compare. |
webcpp::beast::wasi::http_context::http_context
Constructors
Synopses
Declared in <webcpp/beast/wasi/async.hpp>
Constructs an empty host context.
constexpr
http_context() = default;
Forbids duplicated ownership of pending operations.
http_context(http_context const&) = delete;
webcpp::beast::wasi::http_context::http_context
Constructs an empty host context.
webcpp::beast::wasi::http_context::http_context
Forbids duplicated ownership of pending operations.
webcpp::beast::wasi::http_context::~http_context
Cancels and releases pending operations without invoking abandoned handlers.
webcpp::beast::wasi::http_context::operator=
Forbids duplicated ownership of pending operations.
Synopsis
Declared in <webcpp/beast/wasi/async.hpp>
http_context&
operator=(http_context const&) = delete;
webcpp::beast::wasi::http_context::enqueue
Takes ownership of an intrusive readiness operation.
Synopsis
Declared in <webcpp/beast/wasi/async.hpp>
void
enqueue(/* implementation-defined */* value);
Parameters
| Name | Description |
|---|---|
value |
Allocator-owned operation, with its matching destroy function. |
webcpp::beast::wasi::http_context::get_executor
Returns the executor of this context.
Return Value
A borrowing executor.
webcpp::beast::wasi::http_context::poll
Polls each initially queued operation once without waiting for readiness.
Return Value
The number of completed operations or posted functions.
webcpp::beast::wasi::http_context::run
Runs until no owned operation or associated work remains.
Return Value
The number of completed operations or posted functions.
webcpp::beast::wasi::stdio_stream
stdin/stdout or a supplied descriptor pair, borrowed exclusively for this object’s lifetime.
Description
Descriptors are set nonblocking and restored on destruction, never closed. stdout is protocol-only; diagnostics belong on stderr. Readiness and cancellation are checked every ten milliseconds while blocked. This does not provide Unix-domain socket semantics.
Member Functions
| Name | Description |
|---|---|
|
Constructors |
|
Restores borrowed descriptor flags and releases host resources. |
|
Forbids duplicated channel ownership. |
Sets transfer cancellation and deadline. |
|
Reads a partial input span. |
|
Writes a partial output span. |
webcpp::beast::wasi::stdio_stream::stdio_stream
Constructors
Synopses
Declared in <webcpp/beast/wasi/stream.hpp>
Forbids duplicated channel ownership.
stdio_stream(stdio_stream const&) = delete;
Acquires standard streams or borrows an exclusive descriptor pair.
explicit
stdio_stream(
int input_descriptor = STDIN_FILENO,
int output_descriptor = STDOUT_FILENO,
stream_control control = {});
Parameters
| Name | Description |
|---|---|
input_descriptor |
Input descriptor, normally stdin. |
output_descriptor |
Output descriptor, normally stdout. |
control |
Initial cancellation and deadline. |
webcpp::beast::wasi::stdio_stream::stdio_stream
Forbids duplicated channel ownership.
webcpp::beast::wasi::stdio_stream::stdio_stream
Acquires standard streams or borrows an exclusive descriptor pair.
Synopsis
Declared in <webcpp/beast/wasi/stream.hpp>
explicit
stdio_stream(
int input_descriptor = STDIN_FILENO,
int output_descriptor = STDOUT_FILENO,
stream_control control = {});
Parameters
| Name | Description |
|---|---|
input_descriptor |
Input descriptor, normally stdin. |
output_descriptor |
Output descriptor, normally stdout. |
control |
Initial cancellation and deadline. |
webcpp::beast::wasi::stdio_stream::~stdio_stream
Restores borrowed descriptor flags and releases host resources.
webcpp::beast::wasi::stdio_stream::operator=
Forbids duplicated channel ownership.
Synopsis
Declared in <webcpp/beast/wasi/stream.hpp>
stdio_stream&
operator=(stdio_stream const&) = delete;
webcpp::beast::wasi::stdio_stream::control
Sets transfer cancellation and deadline.
Parameters
| Name | Description |
|---|---|
value |
Settings for subsequent operations. |
webcpp::beast::wasi::stdio_stream::read_some
Reads a partial input span.
Synopsis
Declared in <webcpp/beast/wasi/stream.hpp>
template<class Buffers>
std::size_t
read_some(
Buffers const& buffers,
boost::system::error_code& error);
Return Value
The number of bytes transferred before completion or failure.
Template Parameters
| Name | Description |
|---|---|
Buffers |
Asio mutable buffer sequence. |
Parameters
| Name | Description |
|---|---|
buffers |
Destination buffers. |
error |
Receives any transfer failure. |
webcpp::beast::wasi::stdio_stream::write_some
Writes a partial output span.
Synopsis
Declared in <webcpp/beast/wasi/stream.hpp>
template<class Buffers>
std::size_t
write_some(
Buffers const& buffers,
boost::system::error_code& error);
Return Value
The number of bytes transferred before completion or failure.
Template Parameters
| Name | Description |
|---|---|
Buffers |
Asio constant buffer sequence. |
Parameters
| Name | Description |
|---|---|
buffers |
Source buffers. |
error |
Receives any transfer failure. |
webcpp::beast::wasi::stream_control
Cancellation and a deadline for a supplied channel; no background worker is created.
Member Functions
| Name | Description |
|---|---|
Reports cancellation or expiry. |
Data Members
| Name | Description |
|---|---|
Opaque cancellation predicate state. |
|
Optional cancellation predicate. |
|
Absolute deadline, or the maximum time point for none. |
webcpp::beast::wasi::stream_control::check
Reports cancellation or expiry.
Synopsis
Declared in <webcpp/beast/wasi/stream.hpp>
[[nodiscard]]
boost::system::error_code
check() const;
Return Value
An empty error value on success, otherwise the failure.
|
Note
|
The return value should not be discarded. |
webcpp::beast::wasi::stream_control::cancellation_context
Opaque cancellation predicate state.
webcpp::beast::wasi::stream_control::cancelled
Optional cancellation predicate.
webcpp::beast::wasi::stream_control::deadline
Absolute deadline, or the maximum time point for none.
Synopsis
Declared in <webcpp/beast/wasi/stream.hpp>
std::chrono::steady_clock::time_point deadline = std::chrono::steady_clock::time_point::max();
webcpp::beast::wasi::supplied_stream
A borrowed pair of nonblocking host channels.
Description
A zero-byte successful read means EOF. A write of zero bytes means would-block. Providers report would_block when unready and wait handles readiness, deadline and cancellation. The adapter never buffers more than the caller supplies, never closes a channel, and promises no path addressing, socket options or peer credentials.
Type Aliases
| Name | Description |
|---|---|
Partial nonblocking read callback. |
|
Readiness callback, with writing true for output. |
|
Partial nonblocking write callback. |
Member Functions
| Name | Description |
|---|---|
|
Borrows a caller-supplied channel pair. |
Sets transfer cancellation and deadline. |
|
Reads a partial mutable buffer sequence. |
|
Writes a partial constant buffer sequence. |
webcpp::beast::wasi::supplied_stream::read_function
Partial nonblocking read callback.
Synopsis
Declared in <webcpp/beast/wasi/stream.hpp>
using read_function = std::size_t(*)(void*, std::span<char>, boost::system::error_code&);
Return Value
The number of bytes transferred before completion or failure.
webcpp::beast::wasi::supplied_stream::wait_function
Readiness callback, with writing true for output.
Synopsis
Declared in <webcpp/beast/wasi/stream.hpp>
using wait_function = void(*)(void*, bool, stream_control const&, boost::system::error_code&);
Return Value
The corresponding Boost.System error value.
webcpp::beast::wasi::supplied_stream::write_function
Partial nonblocking write callback.
Synopsis
Declared in <webcpp/beast/wasi/stream.hpp>
using write_function = std::size_t(*)(void*, std::span<char const>, boost::system::error_code&);
Return Value
The number of bytes transferred before completion or failure.
webcpp::beast::wasi::supplied_stream::supplied_stream
Borrows a caller-supplied channel pair.
Synopsis
Declared in <webcpp/beast/wasi/stream.hpp>
supplied_stream(
void* context,
read_function reader,
write_function writer,
wait_function wait,
stream_control control = {});
Parameters
| Name | Description |
|---|---|
context |
State shared by channel callbacks. |
reader |
Nonblocking partial read callback. |
writer |
Nonblocking partial write callback. |
wait |
Readiness and cancellation callback. |
control |
Initial cancellation and deadline. |
webcpp::beast::wasi::supplied_stream::control
Sets transfer cancellation and deadline.
Parameters
| Name | Description |
|---|---|
value |
Settings for subsequent operations. |
webcpp::beast::wasi::supplied_stream::read_some
Reads a partial mutable buffer sequence.
Synopsis
Declared in <webcpp/beast/wasi/stream.hpp>
template<class MutableBuffers>
std::size_t
read_some(
MutableBuffers const& buffers,
boost::system::error_code& error);
Return Value
The number of bytes transferred before completion or failure.
Template Parameters
| Name | Description |
|---|---|
MutableBuffers |
Asio mutable buffer sequence. |
Parameters
| Name | Description |
|---|---|
buffers |
Destination buffers. |
error |
Receives transfer failure or end_of_stream. |
webcpp::beast::wasi::supplied_stream::write_some
Writes a partial constant buffer sequence.
Synopsis
Declared in <webcpp/beast/wasi/stream.hpp>
template<class ConstBuffers>
std::size_t
write_some(
ConstBuffers const& buffers,
boost::system::error_code& error);
Return Value
The number of bytes transferred before completion or failure.
Template Parameters
| Name | Description |
|---|---|
ConstBuffers |
Asio constant buffer sequence. |
Parameters
| Name | Description |
|---|---|
buffers |
Source buffers. |
error |
Receives any transfer failure. |
webcpp::beast::wasi::async_perform
Asynchronously performs a host client exchange with bounded readiness steps.
Synopsis
Declared in <webcpp/beast/wasi/async.hpp>
template<
class RequestBody,
class RequestFields,
class ResponseBody,
class ResponseFields,
class CompletionToken,
class Trailers = webcpp::beast_backend::http::fields>
auto
async_perform(
http_context& context,
client& connection,
http::request<RequestBody, RequestFields>& request,
http::response<ResponseBody, ResponseFields>& response,
CompletionToken&& token,
webcpp::wasi::http::transfer_options const& options = transfer_options(),
Trailers* response_trailers = nullptr,
Trailers const* request_trailers = nullptr);
Return Value
The completion token’s result, with decoded response payload byte count.
Template Parameters
| Name | Description |
|---|---|
RequestBody |
Outgoing body type. |
RequestFields |
Outgoing fields type. |
ResponseBody |
Incoming body type. |
ResponseFields |
Incoming fields type. |
CompletionToken |
Token accepting void(error_code, size_t). |
Trailers |
Trailer fields type. |
Parameters
| Name | Description |
|---|---|
context |
Context driving host readiness. |
connection |
Host client whose metadata storage remains alive through completion. |
request |
Source message kept alive through completion. |
response |
Initially empty destination kept alive through completion. |
token |
Completion token preserving executor, allocator and cancellation slot. |
options |
Body limit, cancellation and deadline. |
response_trailers |
Optional destination kept alive through completion. |
request_trailers |
Optional source kept alive through completion. |
webcpp::beast::wasi::async_receive
Asynchronously reads a complete host request with bounded readiness steps.
Synopsis
Declared in <webcpp/beast/wasi/async.hpp>
template<
class Body,
class Fields,
class CompletionToken,
class Trailers = webcpp::beast_backend::http::fields>
auto
async_receive(
http_context& context,
/* implementation-defined */::incoming_request& source,
http::request<Body, Fields>& request,
CompletionToken&& token,
webcpp::wasi::http::transfer_options const& options = transfer_options(),
Trailers* trailers = nullptr);
Return Value
The completion token’s result.
Template Parameters
| Name | Description |
|---|---|
Body |
Destination body type. |
Fields |
Destination fields type. |
CompletionToken |
Token accepting void(error_code, size_t). |
Trailers |
Trailer fields type. |
Parameters
| Name | Description |
|---|---|
context |
Context driving host readiness. |
source |
Incoming resource kept alive through completion. |
request |
Initially empty destination kept alive through completion. |
token |
Completion token preserving executor, allocator and cancellation slot. |
options |
Body limit, cancellation and deadline. |
trailers |
Optional destination kept alive through completion. |
webcpp::beast::wasi::async_send
Asynchronously commits and writes one host response with bounded readiness steps.
Synopsis
Declared in <webcpp/beast/wasi/async.hpp>
template<
class Body,
class Fields,
class CompletionToken,
class Trailers = webcpp::beast_backend::http::fields>
auto
async_send(
http_context& context,
/* implementation-defined */::response_out output,
http::response<Body, Fields>& response,
CompletionToken&& token,
webcpp::wasi::http::transfer_options const& options = transfer_options(),
Trailers const* trailers = nullptr);
Return Value
The completion token’s result.
Template Parameters
| Name | Description |
|---|---|
Body |
Source body type. |
Fields |
Source fields type. |
CompletionToken |
Token accepting void(error_code, size_t). |
Trailers |
Trailer fields type. |
Parameters
| Name | Description |
|---|---|
context |
Context driving host readiness. |
output |
Active response commitment capability. |
response |
Source message kept alive through completion. |
token |
Completion token preserving executor, allocator and cancellation slot. |
options |
Cancellation and deadline. |
trailers |
Optional source kept alive through completion. |
webcpp::beast::wasi::read
Parses one message and retains overread in the caller’s buffer.
Synopsis
Declared in <webcpp/beast/wasi/stream.hpp>
template<
class Stream,
class DynamicBuffer,
bool Request,
class Body,
class Allocator>
std::size_t
read(
Stream& stream,
DynamicBuffer& buffer,
http::parser<Request, Body, Allocator>& parser,
boost::system::error_code& error);
Description
Reads fit the buffer’s remaining maximum capacity. If an incomplete parser needs more input while that capacity is exhausted, reports buffer_overflow.
Return Value
The number of bytes transferred before completion or failure.
Template Parameters
| Name | Description |
|---|---|
Stream |
Supplied stream type. |
DynamicBuffer |
Dynamic buffer type. |
Request |
Whether the parser reads a request. |
Body |
Beast body type. |
Allocator |
Parser fields allocator. |
Parameters
| Name | Description |
|---|---|
stream |
Input channel. |
buffer |
Retained input and overread. |
parser |
Application parser with its limits. |
error |
Receives channel or parser failure. |
webcpp::beast::wasi::receive
Reads a complete host request into the caller’s allocator.
Synopsis
Declared in <webcpp/beast/wasi/http.hpp>
template<
class Body,
class Fields,
class Trailers = webcpp::beast_backend::http::fields>
std::size_t
receive(
webcpp::wasi::http::incoming_request& source,
http::request<Body, Fields>& request,
boost::system::error_code& error,
webcpp::wasi::http::transfer_options const& options = transfer_options(),
Trailers* trailers = nullptr);
Return Value
The number of incoming body payload bytes.
Template Parameters
| Name | Description |
|---|---|
Body |
Beast body type with a BodyReader. |
Fields |
Beast fields type. |
Trailers |
Output fields type for trailers. |
Parameters
| Name | Description |
|---|---|
source |
Owned host request. |
request |
Destination message, initially empty. |
error |
Receives any transfer or parsing failure. |
options |
Body limit, cancellation and deadline. |
trailers |
Optional destination for incoming trailers. |
webcpp::beast::wasi::send
Sends one response, returning logical body payload bytes.
Synopsis
Declared in <webcpp/beast/wasi/http.hpp>
template<
class Body,
class Fields,
class Trailers = webcpp::beast_backend::http::fields>
std::size_t
send(
webcpp::wasi::http::response_out out,
http::response<Body, Fields>& response,
boost::system::error_code& error,
webcpp::wasi::http::transfer_options const& options = transfer_options(),
Trailers const* trailers = nullptr);
Return Value
The number of outgoing body payload bytes.
Template Parameters
| Name | Description |
|---|---|
Body |
Beast body type with a BodyWriter. |
Fields |
Beast fields type. |
Trailers |
Input fields type for trailers. |
Parameters
| Name | Description |
|---|---|
out |
Active response commitment resource. |
response |
Application response. |
error |
Receives any transfer failure. |
options |
Cancellation and deadline. |
trailers |
Optional outgoing trailers. |
webcpp::beast::wasi::write
Serializes one message and returns actual channel bytes.
Synopsis
Declared in <webcpp/beast/wasi/stream.hpp>
template<
class Stream,
bool Request,
class Body,
class Fields>
std::size_t
write(
Stream& stream,
http::message<Request, Body, Fields>& message,
boost::system::error_code& error);
Return Value
The number of bytes transferred before completion or failure.
Template Parameters
| Name | Description |
|---|---|
Stream |
Supplied stream type. |
Request |
Whether the message is a request. |
Body |
Beast body type. |
Fields |
Beast fields type. |
Parameters
| Name | Description |
|---|---|
stream |
Output channel. |
message |
Application message. |
error |
Receives channel or serializer failure. |
webcpp::beast::wasi::transfer_options
Transfer limits and cancellation shared with the host HTTP resources.
webcpp::beast::websocket
Types
| Name | Description |
|---|---|
Bounds bytes buffered for sending and awaiting application reads. |
|
Browser WebSocket with layered operations and Asio completion tokens. |
|
Browser-compatible options, with a deferred allocator-aware decorator. |
Type Aliases
| Name | Description |
|---|---|
HTTP request shape supplied to a WebSocket decorator. |
Enums
| Name | Description |
|---|---|
Kind of WebSocket control event. |
Using Declarations
| Name | Description |
|---|---|
WebSocket close status codes. |
|
WebSocket close status and UTF-8 explanation. |
|
Errors produced by WebSocket protocol operations. |
|
Tests whether a request asks to upgrade to WebSocket. |
|
Compatibility record for browser-owned compression negotiation. |
|
Payload type for a WebSocket control frame. |
|
HTTP response shape used by the guest WebSocket engine. |
webcpp::beast::websocket::request_type
HTTP request shape supplied to a WebSocket decorator.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
using request_type = webcpp::beast_backend::http::request<webcpp::beast_backend::http::empty_body, webcpp::beast_backend::http::basic_fields<std::pmr::polymorphic_allocator<char>>>;
webcpp::beast::websocket::queue_limits
Bounds bytes buffered for sending and awaiting application reads.
webcpp::beast::websocket::queue_limits::receive
Maximum retained payload plus message-record bytes in Wasm, defaulting to 4 MiB.
Description
Includes browser arrivals awaiting executor dispatch, even while the context is stopped.
webcpp::beast::websocket::queue_limits::send
Maximum combined bufferedAmount and unsent fragment bytes, defaulting to 4 MiB.
webcpp::beast::websocket::stream
Browser WebSocket with layered operations and Asio completion tokens.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<
class NextLayer,
bool DeflateSupported = true>
class stream;
Types
| Name | Description |
|---|---|
Selects the stream type for a different executor. |
Type Aliases
| Name | Description |
|---|---|
Executor used to schedule stream operations and their completions. |
|
Type of the layer immediately below this stream. |
Member Functions
| Name | Description |
|---|---|
|
Constructors |
|
Aborts pending host operations and releases browser registrations. |
Disables assignment of stream ownership. |
|
Performs the browser closing handshake and waits for its close event. |
|
Opens a browser WebSocket using the recorded authority and request target. |
|
Completes according to the unsupported-operation policy for browser-owned control frames. |
|
Completes according to the unsupported-operation policy for browser-owned control frames. |
|
Receives one complete WebSocket message into a dynamic buffer. |
|
Receives part of one queued WebSocket message. |
|
Submits a complete message to the browser send queue. |
|
Buffers a message fragment and submits the assembled final message. |
|
|
|
|
|
Performs the browser closing handshake and waits for its close event. |
|
Installs the callback notified of browser-visible close events. |
|
Returns the executor used for asynchronous completions. |
|
Reports whether the last read delivered a binary message. |
|
Reports whether the last read delivered a text message. |
|
Opens a browser WebSocket using the recorded authority and request target. |
|
Reports whether the last read reached the end of its message. |
|
Reports whether the browser WebSocket is currently open. |
|
Returns the immediately underlying layer. |
|
Receives one complete WebSocket message into a dynamic buffer. |
|
|
|
Returns the last close status and reason exposed by the browser. |
|
|
|
|
|
Submits a complete message to the browser send queue. |
|
|
|
Buffers a message fragment and submits the assembled final message. |
Specializations
| Name | Description |
|---|---|
Selects upstream framing for an explicitly supplied byte stream. |
Template Parameters
| Name | Description |
|---|---|
NextLayer |
Underlying browser authority or TLS-intent layer. |
DeflateSupported |
Compatibility parameter; the browser owns extension negotiation. |
webcpp::beast::websocket::stream::executor_type
Executor used to schedule stream operations and their completions.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
using executor_type = NextLayer::executor_type;
webcpp::beast::websocket::stream::rebind_executor
Selects the stream type for a different executor.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<class Executor>
struct rebind_executor;
Type Aliases
| Name | Description |
|---|---|
Stream type with the requested executor binding. |
Template Parameters
| Name | Description |
|---|---|
Executor |
Executor type to bind to the underlying layer. |
webcpp::beast::websocket::stream::rebind_executor::other
Stream type with the requested executor binding.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
webcpp::beast::websocket::stream::stream
Constructors
Synopses
Declared in <webcpp/beast/browser/websocket.hpp>
Disables copying of stream ownership.
Transfers the stream and its pending operation ownership.
Constructs the next layer and allocator-owned WebSocket state.
template<
class First,
class... Args>
requires (!std::is_same_v<std::remove_cvref_t<First>, std::allocator_arg_t>)
explicit
stream(
First&& first,
Args&&... args);
Constructs the next layer and allocator-owned WebSocket state.
template<
class Allocator,
class... Args>
explicit
stream(
std::allocator_arg_t,
Allocator const& allocator,
Args&&... args);
Template Parameters
| Name | Description |
|---|---|
First |
Type of the first argument forwarded to the next layer. |
Args |
Types of the remaining arguments forwarded to the next layer. |
Allocator |
Allocator used for owned state and variable-sized stream storage. |
Parameters
| Name | Description |
|---|---|
other |
Stream whose state and operation ownership are transferred. |
first |
First argument forwarded to the next layer constructor. |
args |
Remaining arguments forwarded to the next layer constructor. |
allocator |
Allocator retained for stream-owned storage. |
webcpp::beast::websocket::stream::stream
Transfers the stream and its pending operation ownership.
Parameters
| Name | Description |
|---|---|
other |
Stream whose state and operation ownership are transferred. |
webcpp::beast::websocket::stream::stream
Constructs the next layer and allocator-owned WebSocket state.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<
class First,
class... Args>
requires (!std::is_same_v<std::remove_cvref_t<First>, std::allocator_arg_t>)
explicit
stream(
First&& first,
Args&&... args);
Template Parameters
| Name | Description |
|---|---|
First |
Type of the first argument forwarded to the next layer. |
Args |
Types of the remaining arguments forwarded to the next layer. |
Parameters
| Name | Description |
|---|---|
first |
First argument forwarded to the next layer constructor. |
args |
Remaining arguments forwarded to the next layer constructor. |
webcpp::beast::websocket::stream::stream
Constructs the next layer and allocator-owned WebSocket state.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<
class Allocator,
class... Args>
explicit
stream(
std::allocator_arg_t,
Allocator const& allocator,
Args&&... args);
Template Parameters
| Name | Description |
|---|---|
Allocator |
Allocator used for owned state and variable-sized stream storage. |
Args |
Types of the remaining arguments forwarded to the next layer. |
Parameters
| Name | Description |
|---|---|
allocator |
Allocator retained for stream-owned storage. |
args |
Remaining arguments forwarded to the next layer constructor. |
webcpp::beast::websocket::stream::~stream
Aborts pending host operations and releases browser registrations.
webcpp::beast::websocket::stream::operator=
Disables assignment of stream ownership.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
webcpp::beast::websocket::stream::async_close
Performs the browser closing handshake and waits for its close event.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<class Token>
auto
async_close(
webcpp::beast_backend::websocket::close_reason reason,
Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code).
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
reason |
Close code and UTF-8 reason passed to the browser. |
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::websocket::stream::async_handshake
Opens a browser WebSocket using the recorded authority and request target.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<class Token>
auto
async_handshake(
webcpp::beast_backend::string_view host,
webcpp::beast_backend::string_view target,
Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code).
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
host |
Hostname to match against the recorded destination authority. |
target |
Origin-form path and query for the browser URL. |
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::websocket::stream::async_ping
Completes according to the unsupported-operation policy for browser-owned control frames.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<class Token>
auto
async_ping(
webcpp::beast_backend::websocket::ping_data const&,
Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code).
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::websocket::stream::async_pong
Completes according to the unsupported-operation policy for browser-owned control frames.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<class Token>
auto
async_pong(
webcpp::beast_backend::websocket::ping_data const& data,
Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code).
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
data |
Control payload, which the browser cannot transmit explicitly. |
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::websocket::stream::async_read
Receives one complete WebSocket message into a dynamic buffer.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<
class DynamicBuffer,
class Token>
auto
async_read(
DynamicBuffer& buffer,
Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code, std::size_t). Cancellation leaves queued messages available for a subsequent read. Only one read may be outstanding, and the destination must outlive completion.
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
DynamicBuffer |
DynamicBuffer type receiving message bytes. |
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
buffer |
Dynamic buffer receiving message bytes and retained until completion. |
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::websocket::stream::async_read_some
Receives part of one queued WebSocket message.
Synopses
Declared in <webcpp/beast/browser/websocket.hpp>
Receives part of one queued WebSocket message.
template<
class Buffers,
class Token>
auto
async_read_some(
Buffers const& buffers,
Token&& token);
Receives part of one queued WebSocket message.
template<
class DynamicBuffer,
class Token>
auto
async_read_some(
DynamicBuffer& buffer,
std::size_t maximum,
Token&& token);
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Buffers |
MutableBufferSequence receiving response or message bytes. |
Token |
Asio completion token selecting the asynchronous result type. |
DynamicBuffer |
DynamicBuffer type receiving message bytes. |
Parameters
| Name | Description |
|---|---|
buffers |
Buffer sequence whose storage remains valid until completion. |
token |
Completion token controlling handler construction and the return type. |
buffer |
Dynamic buffer receiving message bytes and retained until completion. |
maximum |
Maximum message bytes to append in this read. |
webcpp::beast::websocket::stream::async_read_some
Receives part of one queued WebSocket message.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<
class Buffers,
class Token>
auto
async_read_some(
Buffers const& buffers,
Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code, std::size_t). Cancellation leaves queued messages available for a subsequent read. Only one read may be outstanding, and the destination must outlive completion.
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Buffers |
MutableBufferSequence receiving response or message bytes. |
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
buffers |
Buffer sequence whose storage remains valid until completion. |
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::websocket::stream::async_read_some
Receives part of one queued WebSocket message.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<
class DynamicBuffer,
class Token>
auto
async_read_some(
DynamicBuffer& buffer,
std::size_t maximum,
Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code, std::size_t). Cancellation leaves queued messages available for a subsequent read. Only one read may be outstanding, and the destination must outlive completion.
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
DynamicBuffer |
DynamicBuffer type receiving message bytes. |
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
buffer |
Dynamic buffer receiving message bytes and retained until completion. |
maximum |
Maximum message bytes to append in this read. |
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::websocket::stream::async_write
Submits a complete message to the browser send queue.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<
class Buffers,
class Token>
auto
async_write(
Buffers const& buffers,
Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code, std::size_t). Success means the browser accepted the bytes into its queue, not that the peer read them. Exceeding queue_limits::send closes the connection with browser_errc::send_limit.
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Buffers |
ConstBufferSequence providing request or message bytes. |
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
buffers |
Buffer sequence whose storage remains valid until completion. |
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::websocket::stream::async_write_some
Buffers a message fragment and submits the assembled final message.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<
class Buffers,
class Token>
auto
async_write_some(
bool fin,
Buffers const& buffers,
Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code, std::size_t). Success means the browser accepted the bytes into its queue, not that the peer read them. Exceeding queue_limits::send closes the connection with browser_errc::send_limit.
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Buffers |
ConstBufferSequence providing request or message bytes. |
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
fin |
Whether this fragment finishes the message and submits it to the browser. |
buffers |
Buffer sequence whose storage remains valid until completion. |
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::websocket::stream::auto_fragment
auto_fragment overloads
Synopses
Declared in <webcpp/beast/browser/websocket.hpp>
Reports that fragmentation is owned by the browser.
[[nodiscard]]
bool
auto_fragment() const noexcept;
Accepts the browser-owned fragmentation setting.
void
auto_fragment(bool) noexcept;
Return Value
True, because browser framing is not application-controlled.
webcpp::beast::websocket::stream::auto_fragment
Reports that fragmentation is owned by the browser.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
[[nodiscard]]
bool
auto_fragment() const noexcept;
Return Value
True, because browser framing is not application-controlled.
|
Note
|
The return value should not be discarded. |
webcpp::beast::websocket::stream::binary
binary overloads
Synopses
Declared in <webcpp/beast/browser/websocket.hpp>
Reports whether subsequent messages use binary mode.
[[nodiscard]]
bool
binary() const noexcept;
Selects binary mode for subsequent messages.
void
binary(bool value) noexcept;
Return Value
True if outgoing messages use binary mode.
Parameters
| Name | Description |
|---|---|
value |
Whether subsequent messages are binary. |
webcpp::beast::websocket::stream::binary
Reports whether subsequent messages use binary mode.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
[[nodiscard]]
bool
binary() const noexcept;
Return Value
True if outgoing messages use binary mode.
|
Note
|
The return value should not be discarded. |
webcpp::beast::websocket::stream::binary
Selects binary mode for subsequent messages.
Parameters
| Name | Description |
|---|---|
value |
Whether subsequent messages are binary. |
webcpp::beast::websocket::stream::close
Performs the browser closing handshake and waits for its close event.
Synopses
Declared in <webcpp/beast/browser/websocket.hpp>
Performs the browser closing handshake and waits for its close event.
void
close(webcpp::beast_backend::websocket::close_reason reason);
Performs the browser closing handshake and waits for its close event.
Parameters
| Name | Description |
|---|---|
reason |
Close code and UTF-8 reason passed to the browser. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::websocket::stream::close
Performs the browser closing handshake and waits for its close event.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
void
close(webcpp::beast_backend::websocket::close_reason reason);
Description
This synchronous facade suspends the main stack through JSPI or Asyncify. Calling it from an executing handler returns operation_not_supported.
Parameters
| Name | Description |
|---|---|
reason |
Close code and UTF-8 reason passed to the browser. |
webcpp::beast::websocket::stream::close
Performs the browser closing handshake and waits for its close event.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
void
close(
webcpp::beast_backend::websocket::close_reason reason,
ec_type& ec);
Description
This synchronous facade suspends the main stack through JSPI or Asyncify. Calling it from an executing handler returns operation_not_supported.
Parameters
| Name | Description |
|---|---|
reason |
Close code and UTF-8 reason passed to the browser. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::websocket::stream::control_callback
Installs the callback notified of browser-visible close events.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<class Function>
void
control_callback(Function function);
Template Parameters
| Name | Description |
|---|---|
Function |
Callable stored for request decoration or control notification. |
Parameters
| Name | Description |
|---|---|
function |
Callable receiving the control frame kind and payload. |
webcpp::beast::websocket::stream::get_executor
Returns the executor used for asynchronous completions.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
[[nodiscard]]
executor_type
get_executor() const;
Return Value
The executor associated with the underlying context.
|
Note
|
The return value should not be discarded. |
webcpp::beast::websocket::stream::got_binary
Reports whether the last read delivered a binary message.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
[[nodiscard]]
bool
got_binary() const noexcept;
Return Value
True if the last delivered message was binary.
|
Note
|
The return value should not be discarded. |
webcpp::beast::websocket::stream::got_text
Reports whether the last read delivered a text message.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
[[nodiscard]]
bool
got_text() const noexcept;
Return Value
True if the last delivered message was text.
|
Note
|
The return value should not be discarded. |
webcpp::beast::websocket::stream::handshake
Opens a browser WebSocket using the recorded authority and request target.
Synopses
Declared in <webcpp/beast/browser/websocket.hpp>
Opens a browser WebSocket using the recorded authority and request target.
void
handshake(
webcpp::beast_backend::string_view host,
webcpp::beast_backend::string_view target);
Opens a browser WebSocket using the recorded authority and request target.
Parameters
| Name | Description |
|---|---|
host |
Hostname to match against the recorded destination authority. |
target |
Origin-form path and query for the browser URL. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::websocket::stream::handshake
Opens a browser WebSocket using the recorded authority and request target.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
void
handshake(
webcpp::beast_backend::string_view host,
webcpp::beast_backend::string_view target);
Description
This synchronous facade suspends the main stack through JSPI or Asyncify. Calling it from an executing handler returns operation_not_supported.
Parameters
| Name | Description |
|---|---|
host |
Hostname to match against the recorded destination authority. |
target |
Origin-form path and query for the browser URL. |
webcpp::beast::websocket::stream::handshake
Opens a browser WebSocket using the recorded authority and request target.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
void
handshake(
webcpp::beast_backend::string_view host,
webcpp::beast_backend::string_view target,
ec_type& ec);
Description
This synchronous facade suspends the main stack through JSPI or Asyncify. Calling it from an executing handler returns operation_not_supported.
Parameters
| Name | Description |
|---|---|
host |
Hostname to match against the recorded destination authority. |
target |
Origin-form path and query for the browser URL. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::websocket::stream::is_message_done
Reports whether the last read reached the end of its message.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
[[nodiscard]]
bool
is_message_done() const noexcept;
Return Value
True when the last read consumed the message boundary.
|
Note
|
The return value should not be discarded. |
webcpp::beast::websocket::stream::is_open
Reports whether the browser WebSocket is currently open.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
[[nodiscard]]
bool
is_open() const noexcept;
Return Value
True when the layer is available for operations.
|
Note
|
The return value should not be discarded. |
webcpp::beast::websocket::stream::next_layer
Returns the immediately underlying layer.
Synopses
Declared in <webcpp/beast/browser/websocket.hpp>
Returns the immediately underlying layer.
NextLayer&
next_layer() noexcept;
Returns the immediately underlying layer.
[[nodiscard]]
NextLayer const&
next_layer() const noexcept;
Return Value
A reference to the underlying stream.
webcpp::beast::websocket::stream::next_layer
Returns the immediately underlying layer.
Return Value
A reference to the underlying stream.
webcpp::beast::websocket::stream::next_layer
Returns the immediately underlying layer.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
[[nodiscard]]
NextLayer const&
next_layer() const noexcept;
webcpp::beast::websocket::stream::read
Receives one complete WebSocket message into a dynamic buffer.
Synopses
Declared in <webcpp/beast/browser/websocket.hpp>
Receives one complete WebSocket message into a dynamic buffer.
template<class Buffer>
std::size_t
read(Buffer& buffer);
Receives one complete WebSocket message into a dynamic buffer.
Return Value
The number of bytes delivered to the destination.
Template Parameters
| Name | Description |
|---|---|
Buffer |
Dynamic buffer type retained for Beast call compatibility. |
Parameters
| Name | Description |
|---|---|
buffer |
Dynamic buffer receiving message bytes and retained until completion. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::websocket::stream::read
Receives one complete WebSocket message into a dynamic buffer.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<class Buffer>
std::size_t
read(Buffer& buffer);
Description
This synchronous facade suspends the main stack through JSPI or Asyncify. Calling it from an executing handler returns operation_not_supported.
Return Value
The number of bytes delivered to the destination.
Template Parameters
| Name | Description |
|---|---|
Buffer |
Dynamic buffer type retained for Beast call compatibility. |
Parameters
| Name | Description |
|---|---|
buffer |
Dynamic buffer receiving message bytes and retained until completion. |
webcpp::beast::websocket::stream::read
Receives one complete WebSocket message into a dynamic buffer.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<class Buffer>
std::size_t
read(
Buffer& buffer,
ec_type& ec);
Description
This synchronous facade suspends the main stack through JSPI or Asyncify. Calling it from an executing handler returns operation_not_supported.
Return Value
The number of bytes delivered to the destination.
Template Parameters
| Name | Description |
|---|---|
Buffer |
Dynamic buffer type retained for Beast call compatibility. |
Parameters
| Name | Description |
|---|---|
buffer |
Dynamic buffer receiving message bytes and retained until completion. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::websocket::stream::read_message_max
read_message_max overloads
Synopses
Declared in <webcpp/beast/browser/websocket.hpp>
Returns the maximum accepted decoded message size.
[[nodiscard]]
std::size_t
read_message_max() const noexcept;
Sets the largest decoded message accepted from the browser.
void
read_message_max(std::size_t value) noexcept;
Return Value
The maximum accepted message bytes.
Parameters
| Name | Description |
|---|---|
value |
Maximum decoded message bytes; the default is 16 MiB. |
webcpp::beast::websocket::stream::read_message_max
Returns the maximum accepted decoded message size.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
[[nodiscard]]
std::size_t
read_message_max() const noexcept;
webcpp::beast::websocket::stream::read_message_max
Sets the largest decoded message accepted from the browser.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
void
read_message_max(std::size_t value) noexcept;
Parameters
| Name | Description |
|---|---|
value |
Maximum decoded message bytes; the default is 16 MiB. |
webcpp::beast::websocket::stream::reason
Returns the last close status and reason exposed by the browser.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
[[nodiscard]]
webcpp::beast_backend::websocket::close_reason const&
reason() const noexcept;
Return Value
The most recently observed close reason.
|
Note
|
The return value should not be discarded. |
webcpp::beast::websocket::stream::set_option
set_option overloads
Synopses
Declared in <webcpp/beast/browser/websocket.hpp>
Sets the byte limits enforced for outgoing and unread messages.
void
set_option(queue_limits value);
Accepts browser-owned compression negotiation options.
void
set_option(webcpp::beast_backend::websocket::permessage_deflate const&) noexcept;
Records timeout settings for subsequent host operations.
void
set_option(stream_base::timeout const& value);
Stores a request decorator using the stream allocator.
template<class Function>
void
set_option(stream_base::decorator<Function> value);
Template Parameters
| Name | Description |
|---|---|
Function |
Callable stored for request decoration or control notification. |
Parameters
| Name | Description |
|---|---|
value |
Options to retain for subsequent operations. |
webcpp::beast::websocket::stream::set_option
Sets the byte limits enforced for outgoing and unread messages.
Parameters
| Name | Description |
|---|---|
value |
Options to retain for subsequent operations. |
webcpp::beast::websocket::stream::set_option
Accepts browser-owned compression negotiation options.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
void
set_option(webcpp::beast_backend::websocket::permessage_deflate const&) noexcept;
webcpp::beast::websocket::stream::set_option
Records timeout settings for subsequent host operations.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
void
set_option(stream_base::timeout const& value);
Parameters
| Name | Description |
|---|---|
value |
Options to retain for subsequent operations. |
webcpp::beast::websocket::stream::set_option
Stores a request decorator using the stream allocator.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<class Function>
void
set_option(stream_base::decorator<Function> value);
Template Parameters
| Name | Description |
|---|---|
Function |
Callable stored for request decoration or control notification. |
Parameters
| Name | Description |
|---|---|
value |
Options to retain for subsequent operations. |
webcpp::beast::websocket::stream::text
text overloads
Synopses
Declared in <webcpp/beast/browser/websocket.hpp>
Reports whether subsequent messages use text mode.
[[nodiscard]]
bool
text() const noexcept;
Selects text mode for subsequent messages.
void
text(bool value) noexcept;
Return Value
True if outgoing messages use text mode.
Parameters
| Name | Description |
|---|---|
value |
Whether subsequent messages are text. |
webcpp::beast::websocket::stream::text
Reports whether subsequent messages use text mode.
Return Value
True if outgoing messages use text mode.
|
Note
|
The return value should not be discarded. |
webcpp::beast::websocket::stream::text
Selects text mode for subsequent messages.
Parameters
| Name | Description |
|---|---|
value |
Whether subsequent messages are text. |
webcpp::beast::websocket::stream::write
Submits a complete message to the browser send queue.
Synopses
Declared in <webcpp/beast/browser/websocket.hpp>
Submits a complete message to the browser send queue.
template<class Buffers>
std::size_t
write(Buffers const& buffers);
Submits a complete message to the browser send queue.
Return Value
The number of input bytes accepted, or zero on failure.
Template Parameters
| Name | Description |
|---|---|
Buffers |
ConstBufferSequence providing request or message bytes. |
Parameters
| Name | Description |
|---|---|
buffers |
Buffer sequence whose storage remains valid until completion. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::websocket::stream::write
Submits a complete message to the browser send queue.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<class Buffers>
std::size_t
write(Buffers const& buffers);
Description
Success means the browser accepted the bytes into its queue, not that the peer read them. Exceeding queue_limits::send closes the connection with browser_errc::send_limit.
Return Value
The number of input bytes accepted, or zero on failure.
Template Parameters
| Name | Description |
|---|---|
Buffers |
ConstBufferSequence providing request or message bytes. |
Parameters
| Name | Description |
|---|---|
buffers |
Buffer sequence whose storage remains valid until completion. |
webcpp::beast::websocket::stream::write
Submits a complete message to the browser send queue.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<class Buffers>
std::size_t
write(
Buffers const& buffers,
ec_type& ec);
Description
Success means the browser accepted the bytes into its queue, not that the peer read them. Exceeding queue_limits::send closes the connection with browser_errc::send_limit.
Return Value
The number of input bytes accepted, or zero on failure.
Template Parameters
| Name | Description |
|---|---|
Buffers |
ConstBufferSequence providing request or message bytes. |
Parameters
| Name | Description |
|---|---|
buffers |
Buffer sequence whose storage remains valid until completion. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::websocket::stream::write_buffer_bytes
write_buffer_bytes overloads
Synopses
Declared in <webcpp/beast/browser/websocket.hpp>
Returns the compatibility write-buffer hint.
[[nodiscard]]
std::size_t
write_buffer_bytes() const noexcept;
Accepts a compatibility buffer hint without changing browser buffering.
void
write_buffer_bytes(std::size_t) noexcept;
Return Value
The compatibility value 4096.
webcpp::beast::websocket::stream::write_buffer_bytes
Returns the compatibility write-buffer hint.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
[[nodiscard]]
std::size_t
write_buffer_bytes() const noexcept;
webcpp::beast::websocket::stream::write_buffer_bytes
Accepts a compatibility buffer hint without changing browser buffering.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
void
write_buffer_bytes(std::size_t) noexcept;
webcpp::beast::websocket::stream::write_some
Buffers a message fragment and submits the assembled final message.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<class Buffers>
std::size_t
write_some(
bool fin,
Buffers const& buffers,
ec_type& ec);
Description
Success means the browser accepted the bytes into its queue, not that the peer read them. Exceeding queue_limits::send closes the connection with browser_errc::send_limit.
Return Value
The number of input bytes accepted, or zero on failure.
Template Parameters
| Name | Description |
|---|---|
Buffers |
ConstBufferSequence providing request or message bytes. |
Parameters
| Name | Description |
|---|---|
fin |
Whether this fragment finishes the message and submits it to the browser. |
buffers |
Buffer sequence whose storage remains valid until completion. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::websocket::stream<NextLayer, DeflateSupported>
Selects upstream framing for an explicitly supplied byte stream.
Synopsis
Declared in <webcpp/beast/websocket/guest.hpp>
template<
class NextLayer,
bool DeflateSupported>
requires (!std::is_same_v<NextLayer, tcp_stream> &&
!std::is_same_v<NextLayer, ssl_stream<tcp_stream>>)
class stream<NextLayer, DeflateSupported>
: public webcpp::beast_backend::websocket::stream<NextLayer, DeflateSupported>
Base Classes
| Name | Description |
|---|---|
|
Types
| Name | Description |
|---|---|
Selects the guest stream type for another executor. |
Member Functions
| Name | Description |
|---|---|
|
Constructs the guest engine with the upstream allocation behavior. |
Registers a control notification using the facade’s portable frame category. |
|
Adapts facade request and response decorators to the upstream handshake. |
Using Declarations
| Name |
|---|
Template Parameters
| Name | Description |
|---|---|
NextLayer |
User-supplied stream implementing the Beast byte-stream concepts. |
DeflateSupported |
Whether the guest engine supports permessage-deflate. |
webcpp::beast::websocket::stream<NextLayer, DeflateSupported>::rebind_executor
Selects the guest stream type for another executor.
Synopsis
Declared in <webcpp/beast/websocket/guest.hpp>
template<class Executor>
struct rebind_executor;
Type Aliases
| Name | Description |
|---|---|
Stream type with the requested executor binding. |
Template Parameters
| Name | Description |
|---|---|
Executor |
Executor to bind to the next layer. |
webcpp::beast::websocket::stream<NextLayer, DeflateSupported>::rebind_executor::other
Stream type with the requested executor binding.
Synopsis
Declared in <webcpp/beast/websocket/guest.hpp>
webcpp::beast::websocket::stream<NextLayer, DeflateSupported>::stream
Constructs the guest engine with the upstream allocation behavior.
Synopsis
Declared in <webcpp/beast/websocket/guest.hpp>
template<
class Allocator,
class... Args>
explicit
stream(
std::allocator_arg_t,
Allocator const& allocator,
Args&&... args);
Description
The allocator argument preserves constructor compatibility; Boost owns its protocol state.
Template Parameters
| Name | Description |
|---|---|
Allocator |
Allocator used for the facade’s request adaptation. |
Args |
Constructor argument types of the next layer. |
Parameters
| Name | Description |
|---|---|
allocator |
Allocator retained for the facade’s request adaptation. |
args |
Arguments forwarded to the upstream stream constructor. |
webcpp::beast::websocket::stream<NextLayer, DeflateSupported>::control_callback
Registers a control notification using the facade’s portable frame category.
Synopsis
Declared in <webcpp/beast/websocket/guest.hpp>
void
control_callback(std::function<void(frame_type, webcpp::beast_backend::string_view)> callback);
Parameters
| Name | Description |
|---|---|
callback |
Callback invoked with the frame category and payload, or empty to clear. |
webcpp::beast::websocket::stream<NextLayer, DeflateSupported>::set_option
Adapts facade request and response decorators to the upstream handshake.
Synopsis
Declared in <webcpp/beast/websocket/guest.hpp>
template<class Function>
void
set_option(stream_base::decorator<Function> option);
Template Parameters
| Name | Description |
|---|---|
Function |
Callable accepting the facade request or response type. |
Parameters
| Name | Description |
|---|---|
option |
Decorator applied before the guest engine writes its handshake. |
webcpp::beast::websocket::stream<NextLayer, DeflateSupported>::Unnamed using
webcpp::beast::websocket::stream<NextLayer, DeflateSupported>::set_option
webcpp::beast::websocket::stream_base
Browser-compatible options, with a deferred allocator-aware decorator.
Types
| Name | Description |
|---|---|
Stores a callable that records the browser-compatible handshake subprotocols. |
Type Aliases
| Name | Description |
|---|---|
Handshake and idle timeout options shared with Beast. |
webcpp::beast::websocket::stream_base::timeout
Handshake and idle timeout options shared with Beast.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
using timeout = webcpp::beast_backend::websocket::stream_base::timeout;
webcpp::beast::websocket::stream_base::decorator
Stores a callable that records the browser-compatible handshake subprotocols.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
template<class Function>
struct decorator;
Member Functions
| Name | Description |
|---|---|
|
Retains a handshake request decorator. |
Data Members
| Name | Description |
|---|---|
Callable retained for later protocol notification. |
Template Parameters
| Name | Description |
|---|---|
Function |
Callable stored for request decoration or control notification. |
webcpp::beast::websocket::stream_base::decorator::decorator
Retains a handshake request decorator.
Parameters
| Name | Description |
|---|---|
fn |
Callable invoked with the handshake request before opening the browser socket. |
webcpp::beast::websocket::stream_base::decorator::function
Callable retained for later protocol notification.
webcpp::beast::websocket::frame_type
Kind of WebSocket control event.
Members
| Name | Description |
|---|---|
|
A closing handshake notification. |
|
A browser-owned ping control frame. |
|
A browser-owned pong control frame. |
webcpp::beast::websocket::close_code
WebSocket close status codes.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
using webcpp::beast_backend::websocket::close_code;
webcpp::beast::websocket::close_reason
WebSocket close status and UTF-8 explanation.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
using webcpp::beast_backend::websocket::close_reason;
webcpp::beast::websocket::error
Errors produced by WebSocket protocol operations.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
using webcpp::beast_backend::websocket::error;
webcpp::beast::websocket::is_upgrade
Tests whether a request asks to upgrade to WebSocket.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
using webcpp::beast_backend::websocket::is_upgrade;
webcpp::beast::websocket::permessage_deflate
Compatibility record for browser-owned compression negotiation.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
using webcpp::beast_backend::websocket::permessage_deflate;
webcpp::beast::websocket::ping_data
Payload type for a WebSocket control frame.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
using webcpp::beast_backend::websocket::ping_data;
webcpp::beast::websocket::response_type
HTTP response shape used by the guest WebSocket engine.
Synopsis
Declared in <webcpp/beast/browser/websocket.hpp>
using webcpp::beast_backend::websocket::response_type;
webcpp::beast::errc
Upstream generic error conditions.
webcpp::beast::ssl_stream
TLS intent validated before the browser owns the secure connection.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
template<class NextLayer>
class ssl_stream;
Types
| Name | Description |
|---|---|
Selects the stream type for a different executor. |
Type Aliases
| Name | Description |
|---|---|
Executor used to schedule stream operations and their completions. |
|
Type of the layer immediately below this stream. |
Member Functions
| Name | Description |
|---|---|
|
Constructors |
Validates TLS intent and marks the authority secure without opening a TLS socket. |
|
Closes the browser operation associated with the underlying authority. |
|
Returns the executor used for asynchronous completions. |
|
Validates TLS intent and marks the authority secure without opening a TLS socket. |
|
Returns the immediately underlying layer. |
|
Records the requested TLS server name for authority validation. |
|
Records hostname verification or marks a custom callback unsupported. |
|
Records the verification policy for the next TLS-intent validation. |
|
|
Template Parameters
| Name | Description |
|---|---|
NextLayer |
Underlying browser authority or TLS-intent layer. |
webcpp::beast::ssl_stream::executor_type
Executor used to schedule stream operations and their completions.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
using executor_type = NextLayer::executor_type;
webcpp::beast::ssl_stream::next_layer_type
Type of the layer immediately below this stream.
webcpp::beast::ssl_stream::rebind_executor
Selects the stream type for a different executor.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
template<class Executor>
struct rebind_executor;
Type Aliases
| Name | Description |
|---|---|
Stream type with the requested executor binding. |
Template Parameters
| Name | Description |
|---|---|
Executor |
Executor type to bind to the underlying layer. |
webcpp::beast::ssl_stream::rebind_executor::other
Stream type with the requested executor binding.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
using other = ssl_stream<NextLayer::rebind_executor<Executor>::other>;
webcpp::beast::ssl_stream::ssl_stream
Constructors
Synopses
Declared in <webcpp/beast/browser/ssl_stream.hpp>
Constructs the next layer and snapshots browser TLS policy.
template<class Arg>
ssl_stream(
Arg&& arg,
webcpp::asio::ssl::context& context);
Constructs every layer and copied TLS name with the supplied allocator.
template<
class Allocator,
class Arg>
ssl_stream(
std::allocator_arg_t,
Allocator const& allocator,
Arg&& arg,
webcpp::asio::ssl::context& context);
Template Parameters
| Name | Description |
|---|---|
Arg |
Argument forwarded to construct the next layer. |
Allocator |
Allocator retained for owned stream state. |
Parameters
| Name | Description |
|---|---|
arg |
Argument forwarded to the underlying layer constructor. |
context |
TLS context whose configuration is copied at construction. |
allocator |
Allocator used by the layer and its TLS metadata. |
webcpp::beast::ssl_stream::ssl_stream
Constructs the next layer and snapshots browser TLS policy.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
template<class Arg>
ssl_stream(
Arg&& arg,
webcpp::asio::ssl::context& context);
Template Parameters
| Name | Description |
|---|---|
Arg |
Argument forwarded to construct the next layer. |
Parameters
| Name | Description |
|---|---|
arg |
Argument forwarded to the underlying layer constructor. |
context |
TLS context whose configuration is copied at construction. |
webcpp::beast::ssl_stream::ssl_stream
Constructs every layer and copied TLS name with the supplied allocator.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
template<
class Allocator,
class Arg>
ssl_stream(
std::allocator_arg_t,
Allocator const& allocator,
Arg&& arg,
webcpp::asio::ssl::context& context);
Template Parameters
| Name | Description |
|---|---|
Allocator |
Allocator retained for owned stream state. |
Arg |
Argument forwarded to the next layer. |
Parameters
| Name | Description |
|---|---|
allocator |
Allocator used by the layer and its TLS metadata. |
arg |
Argument forwarded to the next layer constructor. |
context |
TLS configuration copied before opening the host connection. |
webcpp::beast::ssl_stream::async_handshake
Validates TLS intent and marks the authority secure without opening a TLS socket.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
template<class Token>
auto
async_handshake(
webcpp::asio::ssl::stream_base::handshake_type type,
Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code). The browser performs certificate validation when fetch or WebSocket opens the URL. Under ERROR, custom roots, credentials, version pins, callbacks, or mismatched names produce operation_not_supported; IGNORE leaves those choices to the browser.
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
type |
Requested TLS role; only client is representable by browser host APIs. |
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::ssl_stream::async_shutdown
Closes the browser operation associated with the underlying authority.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
template<class Token>
auto
async_shutdown(Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code).
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::ssl_stream::get_executor
Returns the executor used for asynchronous completions.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
[[nodiscard]]
executor_type
get_executor() const;
Return Value
The executor associated with the underlying context.
|
Note
|
The return value should not be discarded. |
webcpp::beast::ssl_stream::handshake
Validates TLS intent and marks the authority secure without opening a TLS socket.
Synopses
Declared in <webcpp/beast/browser/ssl_stream.hpp>
Validates TLS intent and marks the authority secure without opening a TLS socket.
void
handshake(webcpp::asio::ssl::stream_base::handshake_type type);
Validates TLS intent and marks the authority secure without opening a TLS socket.
void
handshake(
webcpp::asio::ssl::stream_base::handshake_type type,
boost::system::error_code& ec);
Parameters
| Name | Description |
|---|---|
type |
Requested TLS role; only client is representable by browser host APIs. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::ssl_stream::handshake
Validates TLS intent and marks the authority secure without opening a TLS socket.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
void
handshake(webcpp::asio::ssl::stream_base::handshake_type type);
Description
The browser performs certificate validation when fetch or WebSocket opens the URL. Under ERROR, custom roots, credentials, version pins, callbacks, or mismatched names produce operation_not_supported; IGNORE leaves those choices to the browser.
Parameters
| Name | Description |
|---|---|
type |
Requested TLS role; only client is representable by browser host APIs. |
webcpp::beast::ssl_stream::handshake
Validates TLS intent and marks the authority secure without opening a TLS socket.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
void
handshake(
webcpp::asio::ssl::stream_base::handshake_type type,
boost::system::error_code& ec);
Description
The browser performs certificate validation when fetch or WebSocket opens the URL. Under ERROR, custom roots, credentials, version pins, callbacks, or mismatched names produce operation_not_supported; IGNORE leaves those choices to the browser.
Parameters
| Name | Description |
|---|---|
type |
Requested TLS role; only client is representable by browser host APIs. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::ssl_stream::next_layer
Returns the immediately underlying layer.
Synopses
Declared in <webcpp/beast/browser/ssl_stream.hpp>
Returns the immediately underlying layer.
NextLayer&
next_layer() noexcept;
Returns the immediately underlying layer.
[[nodiscard]]
NextLayer const&
next_layer() const noexcept;
Return Value
A reference to the underlying stream.
webcpp::beast::ssl_stream::next_layer
Returns the immediately underlying layer.
Return Value
A reference to the underlying stream.
webcpp::beast::ssl_stream::next_layer
Returns the immediately underlying layer.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
[[nodiscard]]
NextLayer const&
next_layer() const noexcept;
webcpp::beast::ssl_stream::set_server_name
Records the requested TLS server name for authority validation.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
boost::system::result<void>
set_server_name(std::string_view host);
Return Value
Success, or invalid_argument for an invalid server-name record.
Parameters
| Name | Description |
|---|---|
host |
Hostname to match against the recorded destination authority. |
webcpp::beast::ssl_stream::set_verify_callback
Records hostname verification or marks a custom callback unsupported.
Synopses
Declared in <webcpp/beast/browser/ssl_stream.hpp>
Records hostname verification or marks a custom callback unsupported.
template<class Callback>
void
set_verify_callback(Callback const& callback);
Records hostname verification or marks a custom callback unsupported.
template<class Callback>
void
set_verify_callback(
Callback const& callback,
boost::system::error_code& ec);
Template Parameters
| Name | Description |
|---|---|
Callback |
Verification callable type; only host_name_verification is representable. |
Parameters
| Name | Description |
|---|---|
callback |
Hostname-verification record or unsupported custom callable. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::ssl_stream::set_verify_callback
Records hostname verification or marks a custom callback unsupported.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
template<class Callback>
void
set_verify_callback(Callback const& callback);
Template Parameters
| Name | Description |
|---|---|
Callback |
Verification callable type; only host_name_verification is representable. |
Parameters
| Name | Description |
|---|---|
callback |
Hostname-verification record or unsupported custom callable. |
webcpp::beast::ssl_stream::set_verify_callback
Records hostname verification or marks a custom callback unsupported.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
template<class Callback>
void
set_verify_callback(
Callback const& callback,
boost::system::error_code& ec);
Template Parameters
| Name | Description |
|---|---|
Callback |
Verification callable type; only host_name_verification is representable. |
Parameters
| Name | Description |
|---|---|
callback |
Hostname-verification record or unsupported custom callable. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::ssl_stream::set_verify_mode
Records the verification policy for the next TLS-intent validation.
Synopses
Declared in <webcpp/beast/browser/ssl_stream.hpp>
Records the verification policy for the next TLS-intent validation.
void
set_verify_mode(int mode);
Records the verification policy for the next TLS-intent validation.
void
set_verify_mode(
int mode,
boost::system::error_code& ec);
Parameters
| Name | Description |
|---|---|
mode |
Requested verification flags; strict browser TLS requires verify_peer. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::ssl_stream::set_verify_mode
Records the verification policy for the next TLS-intent validation.
Parameters
| Name | Description |
|---|---|
mode |
Requested verification flags; strict browser TLS requires verify_peer. |
webcpp::beast::ssl_stream::set_verify_mode
Records the verification policy for the next TLS-intent validation.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
void
set_verify_mode(
int mode,
boost::system::error_code& ec);
Parameters
| Name | Description |
|---|---|
mode |
Requested verification flags; strict browser TLS requires verify_peer. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::ssl_stream::shutdown
shutdown overloads
Synopses
Declared in <webcpp/beast/browser/ssl_stream.hpp>
Closes the browser operation associated with the underlying authority.
void
shutdown();
Closes the browser operation associated with the underlying authority.
void
shutdown(boost::system::error_code& ec);
Parameters
| Name | Description |
|---|---|
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::ssl_stream::shutdown
Closes the browser operation associated with the underlying authority.
webcpp::beast::ssl_stream::shutdown
Closes the browser operation associated with the underlying authority.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
void
shutdown(boost::system::error_code& ec);
Parameters
| Name | Description |
|---|---|
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::tcp_stream
A browser authority record, with Beast’s connection and deadline interface.
Types
| Name | Description |
|---|---|
Selects the stream type for a different executor. |
Type Aliases
| Name | Description |
|---|---|
Address and service value recorded by connect. |
|
Executor used to schedule stream operations and their completions. |
|
The authority record at the bottom of a browser stream stack. |
Member Functions
| Name | Description |
|---|---|
|
Constructors |
|
Aborts pending host operations and releases browser registrations. |
Disables assignment of stream ownership. |
|
Records the destination authority and posts the result. |
|
Checks a hostname or host-and-port against the recorded authority. |
|
Connects host cancellation and closure to the authority record. |
|
|
|
|
|
Records the destination authority without opening a raw TCP connection. |
|
Sets an absolute deadline relative to the current steady-clock time. |
|
Sets the deadline for subsequent browser operations. |
|
Disables the authority record deadline. |
|
Returns the deadline recorded for browser operations. |
|
Returns the executor used for asynchronous completions. |
|
Returns the recorded hostname or bracketed IPv6 address. |
|
Reports whether a connection authority has been recorded. |
|
Returns the recorded service port. |
|
Returns the allocation resource retained by this stream. |
|
Returns shared ownership of the stream allocation resource. |
|
|
|
|
|
Closes the browser operation and its authority record. |
|
Returns this authority record through the Beast lowest-layer interface. |
|
Builds a browser URL from the recorded authority and request target. |
Data Members
| Name | Description |
|---|---|
Shared fetch transaction storage retained by the authority record. |
webcpp::beast::tcp_stream::endpoint_type
Address and service value recorded by connect.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
using endpoint_type = webcpp::asio::ip::tcp::endpoint;
webcpp::beast::tcp_stream::executor_type
Executor used to schedule stream operations and their completions.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
using executor_type = webcpp::asio_backend::any_io_executor;
webcpp::beast::tcp_stream::lowest_layer_type
The authority record at the bottom of a browser stream stack.
webcpp::beast::tcp_stream::rebind_executor
Selects the stream type for a different executor.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
template<class Executor>
struct rebind_executor;
Type Aliases
| Name | Description |
|---|---|
Stream type with the requested executor binding. |
Template Parameters
| Name | Description |
|---|---|
Executor |
Executor type to bind to the underlying layer. |
webcpp::beast::tcp_stream::rebind_executor::other
Stream type with the requested executor binding.
webcpp::beast::tcp_stream::tcp_stream
Constructors
Synopses
Declared in <webcpp/beast/browser/tcp_stream.hpp>
Disables copying of stream ownership.
tcp_stream(tcp_stream const&) = delete;
Transfers the stream and its pending operation ownership.
tcp_stream(tcp_stream&& other) noexcept;
Constructs an authority record with no active connection.
explicit
tcp_stream(executor_type executor);
Constructs an authority record with no active connection.
template<class Context>
requires requires(Context& context) { context.get_executor(); }
explicit
tcp_stream(Context& context);
Constructs an authority record with no active connection.
template<class Allocator>
tcp_stream(
std::allocator_arg_t,
Allocator const& allocator,
executor_type executor);
Constructs an authority record with no active connection.
template<
class Allocator,
class Context>
requires requires(Context& context) { context.get_executor(); }
tcp_stream(
std::allocator_arg_t tag,
Allocator const& allocator,
Context& context);
Template Parameters
| Name | Description |
|---|---|
Context |
Execution context providing get_executor(). |
Allocator |
Allocator used for owned state and variable-sized stream storage. |
Parameters
| Name | Description |
|---|---|
other |
Stream whose state and operation ownership are transferred. |
executor |
Executor used to post asynchronous completions. |
context |
Execution context owning the stream executor. |
allocator |
Allocator retained for stream-owned storage. |
tag |
Selects the allocator-aware constructor. |
webcpp::beast::tcp_stream::tcp_stream
Disables copying of stream ownership.
webcpp::beast::tcp_stream::tcp_stream
Transfers the stream and its pending operation ownership.
Parameters
| Name | Description |
|---|---|
other |
Stream whose state and operation ownership are transferred. |
webcpp::beast::tcp_stream::tcp_stream
Constructs an authority record with no active connection.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
explicit
tcp_stream(executor_type executor);
Parameters
| Name | Description |
|---|---|
executor |
Executor used to post asynchronous completions. |
webcpp::beast::tcp_stream::tcp_stream
Constructs an authority record with no active connection.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
template<class Context>
requires requires(Context& context) { context.get_executor(); }
explicit
tcp_stream(Context& context);
Template Parameters
| Name | Description |
|---|---|
Context |
Execution context providing get_executor(). |
Parameters
| Name | Description |
|---|---|
context |
Execution context owning the stream executor. |
webcpp::beast::tcp_stream::tcp_stream
Constructs an authority record with no active connection.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
template<class Allocator>
tcp_stream(
std::allocator_arg_t,
Allocator const& allocator,
executor_type executor);
Template Parameters
| Name | Description |
|---|---|
Allocator |
Allocator used for owned state and variable-sized stream storage. |
Parameters
| Name | Description |
|---|---|
allocator |
Allocator retained for stream-owned storage. |
executor |
Executor used to post asynchronous completions. |
webcpp::beast::tcp_stream::tcp_stream
Constructs an authority record with no active connection.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
template<
class Allocator,
class Context>
requires requires(Context& context) { context.get_executor(); }
tcp_stream(
std::allocator_arg_t tag,
Allocator const& allocator,
Context& context);
Template Parameters
| Name | Description |
|---|---|
Allocator |
Allocator used for owned state and variable-sized stream storage. |
Context |
Execution context providing get_executor(). |
Parameters
| Name | Description |
|---|---|
tag |
Selects the allocator-aware constructor. |
allocator |
Allocator retained for stream-owned storage. |
context |
Execution context owning the stream executor. |
webcpp::beast::tcp_stream::~tcp_stream
Aborts pending host operations and releases browser registrations.
webcpp::beast::tcp_stream::operator=
Disables assignment of stream ownership.
Synopses
Declared in <webcpp/beast/browser/tcp_stream.hpp>
Disables assignment of stream ownership.
tcp_stream&
operator=(tcp_stream const&) = delete;
Disables assignment of stream ownership.
tcp_stream&
operator=(tcp_stream&&) = delete;
webcpp::beast::tcp_stream::operator=
Disables assignment of stream ownership.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
tcp_stream&
operator=(tcp_stream const&) = delete;
webcpp::beast::tcp_stream::operator=
Disables assignment of stream ownership.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
tcp_stream&
operator=(tcp_stream&&) = delete;
webcpp::beast::tcp_stream::async_connect
Records the destination authority and posts the result.
Synopses
Declared in <webcpp/beast/browser/tcp_stream.hpp>
Records the destination authority and posts the result.
template<class Token>
auto
async_connect(
endpoint_type const& endpoint,
Token&& token);
Records the destination authority and posts the result.
template<class Token>
auto
async_connect(
webcpp::asio::ip::tcp::resolver::results_type const& results,
Token&& token);
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
endpoint |
Address and port to record as the destination. |
token |
Completion token controlling handler construction and the return type. |
results |
Resolver results supplying the original hostname and service. |
webcpp::beast::tcp_stream::async_connect
Records the destination authority and posts the result.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
template<class Token>
auto
async_connect(
endpoint_type const& endpoint,
Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code).
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
endpoint |
Address and port to record as the destination. |
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::tcp_stream::async_connect
Records the destination authority and posts the result.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
template<class Token>
auto
async_connect(
webcpp::asio::ip::tcp::resolver::results_type const& results,
Token&& token);
Description
The completion is posted through the associated executor and allocator. The completion signature is void(error_code, endpoint_type).
Return Value
The result determined by the completion token.
Template Parameters
| Name | Description |
|---|---|
Token |
Asio completion token selecting the asynchronous result type. |
Parameters
| Name | Description |
|---|---|
results |
Resolver results supplying the original hostname and service. |
token |
Completion token controlling handler construction and the return type. |
webcpp::beast::tcp_stream::authority_matches
Checks a hostname or host-and-port against the recorded authority.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
[[nodiscard]]
bool
authority_matches(std::string_view host) const;
Return Value
True if the value names the recorded destination.
|
Note
|
The return value should not be discarded. |
Parameters
| Name | Description |
|---|---|
host |
Hostname to match against the recorded destination authority. |
webcpp::beast::tcp_stream::bind
Connects host cancellation and closure to the authority record.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
void
bind(
void* owner,
void(* cancel)(void*),
void(* close)(void*));
Parameters
| Name | Description |
|---|---|
owner |
Object retained by the host operation owner. |
cancel |
Callback invoked to cancel the active host operation. |
close |
Callback invoked to close the active host operation. |
webcpp::beast::tcp_stream::cancel
cancel overloads
Synopses
Declared in <webcpp/beast/browser/tcp_stream.hpp>
Cancels the active host operation and posts its aborted completion.
void
cancel();
Cancels the active host operation and posts its aborted completion.
void
cancel(boost::system::error_code& ec);
Parameters
| Name | Description |
|---|---|
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::tcp_stream::cancel
Cancels the active host operation and posts its aborted completion.
webcpp::beast::tcp_stream::cancel
Cancels the active host operation and posts its aborted completion.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
void
cancel(boost::system::error_code& ec);
Parameters
| Name | Description |
|---|---|
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::tcp_stream::close
close overloads
Synopses
Declared in <webcpp/beast/browser/tcp_stream.hpp>
Closes the authority record and aborts its active host operation.
void
close();
Closes the authority record and aborts its active host operation.
void
close(boost::system::error_code& ec);
Parameters
| Name | Description |
|---|---|
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::tcp_stream::close
Closes the authority record and aborts its active host operation.
webcpp::beast::tcp_stream::close
Closes the authority record and aborts its active host operation.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
void
close(boost::system::error_code& ec);
Parameters
| Name | Description |
|---|---|
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::tcp_stream::connect
Records the destination authority without opening a raw TCP connection.
Synopses
Declared in <webcpp/beast/browser/tcp_stream.hpp>
Records the destination authority without opening a raw TCP connection.
void
connect(endpoint_type const& endpoint);
Records the destination authority without opening a raw TCP connection.
endpoint_type
connect(webcpp::asio::ip::tcp::resolver::results_type const& results);
Records the destination authority without opening a raw TCP connection.
endpoint_type
connect(
endpoint_type const& endpoint,
boost::system::error_code& ec);
Records the destination authority without opening a raw TCP connection.
endpoint_type
connect(
webcpp::asio::ip::tcp::resolver::results_type const& results,
boost::system::error_code& ec);
Return Value
The endpoint corresponding to the recorded authority, or an empty endpoint on failure.
Parameters
| Name | Description |
|---|---|
endpoint |
Address and port to record as the destination. |
results |
Resolver results supplying the original hostname and service. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::tcp_stream::connect
Records the destination authority without opening a raw TCP connection.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
void
connect(endpoint_type const& endpoint);
Parameters
| Name | Description |
|---|---|
endpoint |
Address and port to record as the destination. |
webcpp::beast::tcp_stream::connect
Records the destination authority without opening a raw TCP connection.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
endpoint_type
connect(webcpp::asio::ip::tcp::resolver::results_type const& results);
Return Value
The endpoint corresponding to the recorded authority, or an empty endpoint on failure.
Parameters
| Name | Description |
|---|---|
results |
Resolver results supplying the original hostname and service. |
webcpp::beast::tcp_stream::connect
Records the destination authority without opening a raw TCP connection.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
endpoint_type
connect(
endpoint_type const& endpoint,
boost::system::error_code& ec);
Return Value
The endpoint corresponding to the recorded authority, or an empty endpoint on failure.
Parameters
| Name | Description |
|---|---|
endpoint |
Address and port to record as the destination. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::tcp_stream::connect
Records the destination authority without opening a raw TCP connection.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
endpoint_type
connect(
webcpp::asio::ip::tcp::resolver::results_type const& results,
boost::system::error_code& ec);
Return Value
The endpoint corresponding to the recorded authority, or an empty endpoint on failure.
Parameters
| Name | Description |
|---|---|
results |
Resolver results supplying the original hostname and service. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::tcp_stream::expires_after
Sets an absolute deadline relative to the current steady-clock time.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
template<
class Rep,
class Period>
void
expires_after(std::chrono::duration<Rep, Period> duration);
Template Parameters
| Name | Description |
|---|---|
Rep |
Representation type of the duration count. |
Period |
Tick period of the duration. |
Parameters
| Name | Description |
|---|---|
duration |
Time remaining until the deadline. |
webcpp::beast::tcp_stream::expires_at
Sets the deadline for subsequent browser operations.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
void
expires_at(/* implementation-defined */::time_point time);
Parameters
| Name | Description |
|---|---|
time |
Absolute steady-clock deadline. |
webcpp::beast::tcp_stream::expires_never
Disables the authority record deadline.
webcpp::beast::tcp_stream::expiry
Returns the deadline recorded for browser operations.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
[[nodiscard]]
auto
expiry() const noexcept;
Return Value
The recorded deadline, or time_point::max() when disabled.
|
Note
|
The return value should not be discarded. |
webcpp::beast::tcp_stream::get_executor
Returns the executor used for asynchronous completions.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
[[nodiscard]]
executor_type
get_executor() const noexcept;
Return Value
The executor associated with the underlying context.
|
Note
|
The return value should not be discarded. |
webcpp::beast::tcp_stream::host
Returns the recorded hostname or bracketed IPv6 address.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
[[nodiscard]]
std::string_view
host() const noexcept;
webcpp::beast::tcp_stream::is_open
Reports whether a connection authority has been recorded.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
[[nodiscard]]
bool
is_open() const noexcept;
Return Value
True when the layer is available for operations.
|
Note
|
The return value should not be discarded. |
webcpp::beast::tcp_stream::port
Returns the recorded service port.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
[[nodiscard]]
uint16_t
port() const noexcept;
webcpp::beast::tcp_stream::resource
Returns the allocation resource retained by this stream.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
[[nodiscard]]
std::pmr::memory_resource*
resource() const noexcept;
Return Value
The stream-owned resource; its lifetime is tied to retained resource ownership.
|
Note
|
The return value should not be discarded. |
webcpp::beast::tcp_stream::resource_owner
Returns shared ownership of the stream allocation resource.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
[[nodiscard]]
std::shared_ptr<std::pmr::memory_resource> const&
resource_owner() const noexcept;
Return Value
Shared ownership of the stream allocation resource.
|
Note
|
The return value should not be discarded. |
webcpp::beast::tcp_stream::response_body_limit
response_body_limit overloads
Synopses
Declared in <webcpp/beast/browser/tcp_stream.hpp>
Returns the maximum decoded fetch body size in bytes.
[[nodiscard]]
std::size_t
response_body_limit() const noexcept;
Sets the maximum decoded fetch body size in bytes.
void
response_body_limit(std::size_t value) noexcept;
Return Value
The maximum decoded body size in bytes.
Parameters
| Name | Description |
|---|---|
value |
Maximum decoded response bytes; the default is 8 MiB. |
webcpp::beast::tcp_stream::response_body_limit
Returns the maximum decoded fetch body size in bytes.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
[[nodiscard]]
std::size_t
response_body_limit() const noexcept;
webcpp::beast::tcp_stream::response_body_limit
Sets the maximum decoded fetch body size in bytes.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
void
response_body_limit(std::size_t value) noexcept;
Parameters
| Name | Description |
|---|---|
value |
Maximum decoded response bytes; the default is 8 MiB. |
webcpp::beast::tcp_stream::secure
secure overloads
Synopses
Declared in <webcpp/beast/browser/tcp_stream.hpp>
Reports whether browser URLs use TLS.
[[nodiscard]]
bool
secure() const noexcept;
Records whether browser URLs use TLS.
void
secure(bool value) noexcept;
Return Value
True when secure URL schemes are selected.
Parameters
| Name | Description |
|---|---|
value |
Whether subsequent URLs use https or wss. |
webcpp::beast::tcp_stream::secure
Reports whether browser URLs use TLS.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
[[nodiscard]]
bool
secure() const noexcept;
Return Value
True when secure URL schemes are selected.
|
Note
|
The return value should not be discarded. |
webcpp::beast::tcp_stream::secure
Records whether browser URLs use TLS.
Parameters
| Name | Description |
|---|---|
value |
Whether subsequent URLs use https or wss. |
webcpp::beast::tcp_stream::shutdown
Closes the browser operation and its authority record.
Synopses
Declared in <webcpp/beast/browser/tcp_stream.hpp>
Closes the browser operation and its authority record.
void
shutdown(webcpp::asio_backend::socket_base::shutdown_type what);
Closes the browser operation and its authority record.
void
shutdown(
webcpp::asio_backend::socket_base::shutdown_type,
boost::system::error_code& ec);
Parameters
| Name | Description |
|---|---|
what |
Shutdown direction; browser host operations close as a whole. |
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::tcp_stream::shutdown
Closes the browser operation and its authority record.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
void
shutdown(webcpp::asio_backend::socket_base::shutdown_type what);
Parameters
| Name | Description |
|---|---|
what |
Shutdown direction; browser host operations close as a whole. |
webcpp::beast::tcp_stream::shutdown
Closes the browser operation and its authority record.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
void
shutdown(
webcpp::asio_backend::socket_base::shutdown_type,
boost::system::error_code& ec);
Parameters
| Name | Description |
|---|---|
ec |
Receives the operation error, or is cleared on success. |
webcpp::beast::tcp_stream::socket
Returns this authority record through the Beast lowest-layer interface.
Synopses
Declared in <webcpp/beast/browser/tcp_stream.hpp>
Returns this authority record through the Beast lowest-layer interface.
tcp_stream&
socket() noexcept;
Returns this authority record through the Beast lowest-layer interface.
[[nodiscard]]
tcp_stream const&
socket() const noexcept;
Return Value
A reference to this authority record.
webcpp::beast::tcp_stream::socket
Returns this authority record through the Beast lowest-layer interface.
Return Value
A reference to this authority record.
webcpp::beast::tcp_stream::socket
Returns this authority record through the Beast lowest-layer interface.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
[[nodiscard]]
tcp_stream const&
socket() const noexcept;
webcpp::beast::tcp_stream::url
Builds a browser URL from the recorded authority and request target.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
[[nodiscard]]
std::pmr::string
url(
std::string_view target,
bool websocket = false) const;
Parameters
| Name | Description |
|---|---|
target |
Origin-form path and query for the browser URL. |
websocket |
Selects ws or wss instead of http or https. |
webcpp::beast::tcp_stream::http_state
Shared fetch transaction storage retained by the authority record.
webcpp::beast::browser_errc
Browser failures without a corresponding Beast or Asio error.
Members
| Name | Description |
|---|---|
|
The browser rejected a URL or WebSocket subprotocol syntax. |
|
Browser security policy blocked the operation. |
|
The browser could not establish the WebSocket connection. |
|
The outgoing WebSocket queue exceeded its configured bound. |
|
Unread WebSocket messages exceeded their configured queue bound. |
|
Fetch failed without an exposed cause, including network and CORS failures. |
|
The operation has no usable recorded destination authority. |
webcpp::beast::browser_category
Returns the stable browser error category.
Synopsis
Declared in <webcpp/beast/browser/error.hpp>
boost::system::error_category const&
browser_category() noexcept;
Return Value
The process-lifetime browser error category.
webcpp::beast::make_error_code
Converts a browser failure into its stable error-code representation.
Synopsis
Declared in <webcpp/beast/browser/error.hpp>
boost::system::error_code
make_error_code(browser_errc code) noexcept;
Return Value
The code associated with browser_category().
Parameters
| Name | Description |
|---|---|
code |
Browser error enumerator. |
webcpp::beast::set_server_name
Records the requested TLS server name for authority validation.
Synopsis
Declared in <webcpp/beast/browser/ssl_stream.hpp>
template<class NextLayer>
boost::system::result<void>
set_server_name(
ssl_stream<NextLayer>& stream,
std::string_view host);
Return Value
Success, or invalid_argument for an invalid server-name record.
Template Parameters
| Name | Description |
|---|---|
NextLayer |
Underlying browser authority or TLS-intent layer. |
Parameters
| Name | Description |
|---|---|
stream |
Browser stream whose recorded authority selects the host operation. |
host |
Hostname to match against the recorded destination authority. |
webcpp::beast::basic_flat_buffer
Upstream contiguous dynamic buffer with an application-supplied allocator.
webcpp::beast::basic_multi_buffer
Upstream segmented dynamic buffer with an application-supplied allocator.
webcpp::beast::bind_front_handler
Binds leading arguments to a completion handler.
webcpp::beast::buffers_prefix
Returns a view of the first bytes of a buffer sequence.
webcpp::beast::buffers_to_string
Copies a buffer sequence to a string.
webcpp::beast::error
Upstream common stream errors, including timeout.
webcpp::beast::error_code
The error-code type used by Beast operations.
webcpp::beast::file_mode
Upstream file-opening modes for explicit file bodies.
webcpp::beast::flat_buffer
Upstream contiguous dynamic buffer.
webcpp::beast::flat_static_buffer
Upstream contiguous buffer with fixed capacity.
webcpp::beast::get_lowest_layer
Finds the innermost layer of a composed stream.
Synopsis
Declared in <webcpp/beast/browser/tcp_stream.hpp>
using webcpp::beast_backend::get_lowest_layer;
webcpp::beast::iequals
Compares strings with HTTP’s ASCII case-insensitive rules.
webcpp::beast::make_printable
Formats a buffer sequence for diagnostic output.
webcpp::beast::multi_buffer
Upstream segmented dynamic buffer.
webcpp::beast::ostream
Creates an output stream that appends to a dynamic buffer.
webcpp::beast::role_type
Client or server role used by protocol options.
webcpp::beast::static_buffer
Upstream fixed-capacity buffer.
webcpp::beast::string_view
Upstream non-owning string view.
webcpp::beast::system_error
Upstream exception type for explicitly throwing application code.
WEBCPP_BEAST_BACKEND_HEADER
Selects a protocol implementation header for internal use.
Synopsis
Declared in <webcpp/beast/detail/backend_select.hpp>
#define WEBCPP_BEAST_BACKEND_HEADER(header)
Parameters
| Name | Description |
|---|---|
header |
The path relative to the backend include root. |
WEBCPP_BEAST_HAS_OPENSSL_BACKEND
1 when guest OpenSSL can be linked on the selected target; does not link it.
WEBCPP_BEAST_HAS_SOCKET_BACKEND
1 when the selected Asio backend supplies native or WASI guest sockets.
WEBCPP_BEAST_NO_EXCEPTIONS
Records the facade’s exception policy for host-adapter implementations.
Description
Defined automatically when webcpp has no exceptions, or explicitly by the application. Host adapters report recoverable failures through error codes. Inherited upstream overloads and data types retain Boost’s own exception configuration.
WEBCPP_BEAST_UNSUPPORTED_ERROR
Reports unsupported host operations as errors, the default policy.
WEBCPP_BEAST_UNSUPPORTED_ERROR
Reports unsupported host operations as errors, the default policy.
WEBCPP_BEAST_UNSUPPORTED_IGNORE
Allows documented unsupported settings to be ignored by host adapters.
WEBCPP_BEAST_WASI_HTTP_EXPORT
Exports the P2 host server.
Parameters
| Name | Description |
|---|---|
handler |
Callable building a response or variant for one request. |
Appendix A: Changelog
Changes to the unreleased Beast facade.
Unreleased
-
Fixed browser HTTP and WebSocket transfers with shared Wasm memory.
-
Added current application coverage and shared Release parser measurements.
webcpp 0.1.0
-
Added portable HTTP data interfaces and native/WASIp3 socket operations.
-
Added optional guest TLS SNI configuration with hostname validation.
-
Added browser WebSocket and fetch adapters with explicit capability policies.
-
Added WASI host HTTP and supplied-stream application counterparts.
-
Fixed WebSocket executor conversion when per-message compression is disabled.
-
Fixed host completion storage lifetime and support for PMR operation allocators.
-
Fixed supplied-stream HTTP reads with small bounded buffers.
-
Added executable examples, API reference and a verified target matrix.