Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
9793749
trystero: the native backend's WebRTC over webcpp::webrtc, without ex…
Nov 14, 2026
6a39d77
trystero: the browser backend's WebRTC over webcpp::webrtc, on webcpp…
Nov 14, 2026
0d9e5ed
trystero: webcpp::webrtc in the documentation, the changelog and the …
Nov 14, 2026
caa01c1
trystero: keep the backend's WebRTC and its tests to clang-tidy
Nov 14, 2026
528a4e6
trystero: a clean page, its reference read for Emscripten's target
Nov 14, 2026
f11dd5f
trystero: Boost for what the core wrote itself: Endian, Unordered wit…
Nov 14, 2026
bb004b1
trystero: the native relays on webcpp::beast, their URLs through Boos…
Nov 14, 2026
eec0841
trystero: the browser on webcpp::asio's run family
Nov 14, 2026
c150aa8
trystero: the page says a browser program runs its io_context
Nov 14, 2026
690890b
trystero: the protocol test keeps each decoded frame alive and its li…
Nov 14, 2026
443ca98
trystero: keep the relay session to clang-tidy
Nov 14, 2026
41218bd
trystero: the relay session's OpenSSL branches on every target but Em…
Nov 14, 2026
825f07c
trystero: an IPv6 relay's handshake host written without a fluent chain
Nov 14, 2026
a011d7c
trystero: a page calls C++ through browser::page_call
Nov 14, 2026
c91aff2
trystero: merge the browser on webcpp::asio's run model (WP1)
Nov 14, 2026
4c36557
trystero: the guide's embedded-roots backend, included from its test
Nov 14, 2026
0a8d6c9
trystero: merge the native relays on webcpp::beast (WP2)
Nov 14, 2026
9835aba
trystero: interop judges the public connection by the page's negotiat…
Nov 14, 2026
ea01925
trystero: one platform backend for both targets, platform::backend
Nov 14, 2026
03f62cb
Merge branch 'refactor' of /Users/rodrigo/dev/webcpporg/webrtc-guidel…
Nov 14, 2026
dbf78df
trystero: the first phase's texts applied, its changelog in ten lines
Nov 14, 2026
dd2203f
Merge branch 'refactor' of /Users/rodrigo/dev/webcpporg/webrtc-guidel…
Nov 14, 2026
438abfb
trystero: the core's time as std::chrono, Nostr's kinds and times typed
Nov 14, 2026
9840b00
trystero: fixed-width integers in the protocol and the room tests
Nov 14, 2026
d5cbc9c
trystero: the guide, AGENTS.md and the changelog name the platform ba…
Nov 14, 2026
431b253
trystero: no move of a pmr circular buffer's holder; random_id's bias…
Nov 14, 2026
81dc4a9
trystero: remember only NIP-01 event ids, and test the dedup's key
Nov 14, 2026
b416047
trystero: a relay is verified whatever the verify mode of the program…
Nov 14, 2026
9c53f0b
trystero: merge the first phase's texts into WP5
Nov 14, 2026
0f5755d
trystero: a TLS context's error is the one OpenSSL queued last
Nov 14, 2026
439ea28
trystero: oracle cases for JSON quoting and keys written twice
Nov 14, 2026
74a965b
trystero: a relay's host is an address or a name once decoded
Nov 14, 2026
952b3e9
trystero: the IPv6 relay case does not apply where no IPv6 socket opens
Nov 14, 2026
44b5f10
trystero: the relay session's reads and writes complete through an er…
Nov 14, 2026
c602233
trystero: say exactly what a native relay connection allocates outsid…
Nov 14, 2026
2935cfc
trystero: a relay URL a page reads otherwise is refused, and the guid…
Nov 14, 2026
02d9af0
Merge branch 'refactor' of /Users/rodrigo/dev/webcpporg/webrtc-guidel…
Nov 14, 2026
1965443
trystero: the allocation test's arenas left uninitialized
Nov 14, 2026
47412f4
trystero: the allocation test's arenas are std::arrays the heap holds
Nov 14, 2026
631151f
trystero: merge the core's fixed-meaning types and std::chrono (WP5)
Nov 14, 2026
f2ae0c4
trystero: a page's sealer awaits Web Crypto through the io_context's …
Nov 14, 2026
83666dd
trystero: the tests read and write JSON with webcpp::document
Nov 14, 2026
19eceb5
trystero: a page_call's handler lets no JavaScript error out
Nov 14, 2026
34ebfba
trystero: a page's relay and sealer handlers run outside its events
Nov 15, 2026
67746a6
trystero: page_call says what its memory holds and when it reads the …
Nov 15, 2026
2fd362c
trystero: the new page tests pass clang-tidy
Nov 15, 2026
e796bfd
Merge branch 'refactor' of /Users/rodrigo/dev/webcpporg/webrtc-guidel…
Nov 15, 2026
1a23d42
trystero: the backend takes its window by the core's time point, and …
Nov 15, 2026
c214f01
trystero: AGENTS.md, the testing page and the guarantees name the rev…
Nov 15, 2026
f084eba
Merge branch 'refactor' of /Users/rodrigo/dev/webcpporg/webrtc-guidel…
Nov 15, 2026
7f76a5a
trystero: the bound test's posted send loop is exempt from misc-no-re…
Nov 15, 2026
a3e0c5f
trystero: twins and difference programs over a local relay, the first…
Nov 15, 2026
71fc751
trystero: the guide builds: a test names the platform's relays anchor…
Nov 15, 2026
ad198e1
trystero: the protocol's JSON on webcpp::document
Nov 15, 2026
3dc86fb
trystero: the protocol test reads with webcpp::document and checks th…
Nov 15, 2026
c07b8ba
trystero: the allocation test measures webcpp::document's working state
Nov 15, 2026
23440f2
trystero: the guide on webcpp::document's JSON
Nov 15, 2026
d93bb51
trystero: an answerer's signal in Trystero's member order, and a sign…
Nov 15, 2026
4859fd4
Merge branch 'refactor' of /Users/rodrigo/dev/webcpporg/webrtc-guidel…
Nov 15, 2026
8366f9d
trystero: the oracle's results for the answerer's order and a signal …
Nov 15, 2026
5408639
trystero: the backend's clocks are std::chrono's, steady_now and unix…
Nov 15, 2026
a0cfac5
trystero: the guide shows a JSON payload from the room test, and builds
Nov 15, 2026
33bc65e
trystero: the backend tests count in std::size_t and read the page in…
Nov 15, 2026
1dad176
trystero: six more difference programs and their twins
Nov 15, 2026
96bc60f
Merge branch 'refactor' of /Users/rodrigo/dev/webcpporg/webrtc-guidel…
Nov 15, 2026
fd748df
trystero: the allocation test chooses its target by config's macro, a…
Nov 15, 2026
c82e456
trystero: the platform's clocks say where a page reads them
Nov 15, 2026
2305cf3
trystero: merge WP7's JSON on webcpp::document into the seam's clocks
Nov 15, 2026
02c3adf
trystero: the allocation test counts its windows in std::size_t
Nov 15, 2026
58a41c7
trystero: the difference programs on the platform backend, in the lan…
Nov 15, 2026
f583207
trystero: AGENTS.md says the rooms' JSON is webcpp::document's
Nov 15, 2026
648331b
trystero: WP7's JSON code to the pinned clang-tidy
Nov 15, 2026
06806de
trystero: steady_now's signature names its clock with lint-world
Nov 15, 2026
aaf67b8
trystero: merge the backend's clocks as std::chrono (seam-clock)
Nov 15, 2026
41fe393
trystero: one quick start, two peers over a relay, with its agreeing …
Nov 15, 2026
313d481
Merge branch 'refactor' of /Users/rodrigo/dev/webcpporg/webrtc-guidel…
Nov 15, 2026
7e24a4a
trystero: the relay configuration's program reads the seam's std::chr…
Nov 15, 2026
059fa93
trystero: the relay sockets' difference, and the self id that is not …
Nov 15, 2026
1b1d018
trystero: the appendix shows each difference beside its twin, and the…
Nov 15, 2026
4128cc1
trystero: remember an event id only once it is the event's own, and t…
Nov 15, 2026
e9e146f
trystero: the already-joined program's second result is const
Nov 15, 2026
e466103
Merge branch 'refactor' of /Users/rodrigo/dev/webcpporg/webrtc-guidel…
Nov 15, 2026
6f20d6c
trystero: the reason no program shows a repeated event, after its che…
Nov 15, 2026
62cb27a
trystero: the appendix says the last difference has no twin
Nov 15, 2026
830b3cd
trystero: an answerer's signals and JSON payloads against Trystero's own
Nov 15, 2026
413a81b
Merge branch 'refactor' of /Users/rodrigo/dev/webcpporg/webrtc-guidel…
Nov 15, 2026
8253119
trystero: a handshake message and a remote candidate at their bounds,…
Nov 15, 2026
cd97f85
trystero: the JSON writer returns its error, and the UTF-8 guards are…
Nov 15, 2026
1ffc7a6
trystero: the relays' session as the WP4 review asks
Nov 15, 2026
c07ae1b
trystero: a page's randomness and sealer let no JavaScript exception in
Nov 15, 2026
ca895f0
trystero: a page_call's handler checks a number's range before readin…
Nov 15, 2026
ba7cc2e
trystero: stale words of the two backends, and a broken comment
Nov 15, 2026
215e0d5
trystero: merge refactor (WP5 review fixes and WP6) into wp4-review
Nov 15, 2026
c883bb5
trystero: the guide and AGENTS.md on the reviewed relays, TLS and ran…
Nov 15, 2026
14e965a
trystero: the changelog and the guide name WP7's breaking changes and…
Nov 15, 2026
c78bd49
trystero: long lines wrapped, read_signal's Doc Comment, and what the…
Nov 15, 2026
46b4e93
trystero: a JSON payload's Doc Comments say what of JSON.stringify's …
Nov 15, 2026
bf631da
trystero: the new tests and the candidate writer to the pinned clang-…
Nov 15, 2026
502f4f1
trystero: the guide names the path characters a relay's URL may not hold
Nov 15, 2026
6464d87
trystero: merge refactor (WP7 review fixes) into wp4-review
Nov 15, 2026
a5c9bc3
trystero: every JSON text is parsed into a webcpp::document::pmr::doc…
Nov 15, 2026
14ff219
trystero: merge the WP7 review's fixes into document-pmr
Nov 15, 2026
db15a94
trystero: the guide on documents in the room's resource
Nov 15, 2026
644d265
trystero: programs show a JSON payload's exact numbers and the payloa…
Nov 15, 2026
17eb143
trystero: merge the programs of a JSON payload's differences into doc…
Nov 15, 2026
f5e5caa
trystero: diff_json_refused shows a payload of many small values refused
Nov 15, 2026
b313c88
trystero: AGENTS.md names the one std::bad_alloc a room raises
Nov 15, 2026
1ba81cb
trystero: the reviewed relays' code and tests to the pinned clang-tidy
Nov 15, 2026
ace65d7
trystero: a relay's refusal body is not read, a test that fails until…
Nov 15, 2026
81fa1bd
trystero: merge the WP4 review's fixes (wp4-review)
Nov 15, 2026
9d17814
trystero: a JSON payload up to the room's bound, protocol texts 16 deep
Nov 15, 2026
c91035b
trystero: a room delivers a JSON payload nested 256 deep
Nov 15, 2026
25ccc3e
trystero: the flood test runs on the virtual clock
Nov 15, 2026
7bf2d73
trystero: merge the flood test on the virtual clock (flood-flake)
Nov 15, 2026
504b27f
trystero: merge refactor (wp4-review and the flood test on the virtua…
Nov 15, 2026
ab56581
trystero: a relay's refusal has its header read alone, through beast'…
Nov 15, 2026
40b8f35
trystero: a rejected receive holds nothing, and Asyncify's parse fits…
Nov 15, 2026
f70da8e
trystero: protocol.adoc names Boost.JSON's parse functions as Asciido…
Nov 15, 2026
1649f3c
trystero: the room test's last timing cases on the virtual clock
Nov 15, 2026
541102b
trystero: the room test asks node for 300 s
Nov 15, 2026
10aafd5
trystero: merge the WP4 review's fixes and the flood test on the virt…
Nov 15, 2026
9c3d71c
trystero: the memory backend's scaled wall clock removed
Nov 15, 2026
0c19c59
trystero: merge the room test's timing cases on the virtual clock (wa…
Nov 15, 2026
47a63ea
trystero: merge the room test's timing cases on the virtual clock int…
Nov 15, 2026
2af7906
trystero: the decoding context and the payload factor test to the pin…
Nov 15, 2026
54765f6
trystero: three room cases wait for what they check
Nov 15, 2026
837c6df
trystero: merge three room cases that wait for what they check (wall-…
Nov 15, 2026
ff40d04
trystero: an offer being opened keeps its negotiation's place
Nov 15, 2026
cad2200
trystero: each test case in a frame of its own, and the deepest in re…
Nov 15, 2026
e037e94
trystero: the room test's node bound, measured again
Nov 15, 2026
12588ea
trystero: merge refactor into asyncify-stack
Nov 15, 2026
37e16de
trystero: a negotiation opens one offer of its peer at a time
Nov 15, 2026
459b08c
trystero: merge refactor into one-open
Nov 15, 2026
203cff2
trystero: the changelog's ten lines for the whole refactor
Nov 15, 2026
6f35b38
trystero: the allocation test's comment says document's working state…
Nov 15, 2026
370bbb2
trystero: the Asyncify measurements under the release link at -O3
Nov 15, 2026
16c00a1
trystero: no colon after a reference in a Doc Comment
Nov 15, 2026
b2cb954
trystero: the Asyncify list of Boost.JSON's parser only where JSON is…
Nov 15, 2026
781f7ba
trystero: the release Asyncify tests form the own lane asyncify
Nov 15, 2026
191cf99
trystero: abandoning a relay session allocates nothing, and the JSON …
Nov 15, 2026
63e519e
trystero: a kept room frame advertises its room, as the peer's presen…
Nov 15, 2026
3820d62
trystero: the changelog names the room that never bound after a lost …
Nov 15, 2026
0d21db6
trystero: tests count allocations without a standard container's own
Nov 16, 2026
c810bd6
Merge trystero's main into refactor: libsecp256k1 from webcpp's third…
Nov 16, 2026
3b06b73
trystero: the refactor's functions that return a result are [[nodisca…
Nov 16, 2026
2eb1c89
trystero: the changelog's clocks line keeps its code spans whole
Nov 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
714 changes: 540 additions & 174 deletions AGENTS.md

Large diffs are not rendered by default.

337 changes: 208 additions & 129 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions asyncify-remove.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["*boost::json::basic_parser<*>::parse_*"]
91 changes: 63 additions & 28 deletions build.jam
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,82 @@
# https://www.boost.org/LICENSE_1_0.txt)
#
# trystero, serverless WebRTC rooms, wire compatible with Trystero. A program
# uses /webcpp/trystero//trystero, the rooms and the browser backend, or
# /webcpp/trystero//native for the native backend.
# uses /webcpp/trystero//platform, the rooms and the platform backend, on
# both targets; /webcpp/trystero//trystero is the rooms alone, over a backend
# of the program's own, as the tests' memory relays are.

project /webcpp/trystero ;

# libsecp256k1 (every room) is webcpp's build of it, /third_party//secp256k1:
# v0.8.0 from the submodule third_party/libs/secp256k1, with the tables the
# feature webcpp-secp256k1-tables chooses (small on emscripten, large natively;
# CODING-GUIDELINES.md chapter 5). Native WebRTC and OpenSSL are pinned source
# dependencies too, built together for the consumer's B2 variant.
# CODING-GUIDELINES.md chapter 5). WebRTC is webcpp::webrtc's, whose native
# libdatachannel and its OpenSSL are pinned source dependencies, built
# together for the consumer's B2 variant.
import errors ;

# The native backend's own dependencies, checked only when a target that
# uses it is built.
rule native-dependencies ( properties * )
# The platform backend's own dependencies, checked only when a target that
# uses it is built: natively its WebRTC, libdatachannel's through
# webcpp::webrtc, runs on worker threads.
rule platform-dependencies ( properties * )
{
if <threading>single in $(properties)
if <threading>single in $(properties) && ! <toolset>emscripten in $(properties)
{
errors.user-error "Trystero's native backend uses worker threads. Add <threading>multi to the consuming target or pass threading=multi." ;
errors.user-error "Trystero's platform backend uses worker threads natively. Add <threading>multi to the consuming target or pass threading=multi." ;
}
}

# On emscripten, the browser has no threads (the event loop drives Asio), and
# the browser backend reaches the page through embind: -lembind, what b2's
# <embind>on links, which as a usage requirement it would drop (measured: a
# program then fails to link, undefined _embind_register_function), since
# b2 takes only free features from usage requirements.
# The rooms: Asio is webcpp::asio, natively Boost.Asio itself, on emscripten
# the shipped backend, without threads (main runs it), which links embind.
# Every JSON text the rooms read or write is webcpp::document's, which brings
# Boost.JSON's parser and Boost.Charconv's definitions.
#
# Under Asyncify, Boost.JSON's recursive descent, basic_parser's parse_*
# functions, is left uninstrumented (asyncify-remove.json), since none
# suspends. Instrumented, a level of a parse took some 6.5 KB of node's
# stack in a debug build before the engine optimized it, so that a peer's
# first JSON payload nested 256 deep, document's default, overflowed node's
# 984 KB at about 150 levels; uninstrumented, at 400, and in a release build
# past 1,000 (measured). A program whose own parse suspends from a
# selector's callback cannot link trystero under Asyncify; under JSPI
# nothing is left out.
#
# trystero is parts and that list. parts, the same headers and dependencies
# without it, is for a program of a part that parses no JSON, as trystero's
# tests of the timer, a relay's URL, a page's calls and the sealer are
# (test/Jamfile): such a program has none of the parser's functions, and
# Binaryen warns of a pattern of the list that names none.
path-constant WEBCPP_TRYSTERO_ROOT : . ;
# tag::trystero[]
alias trystero : :
: : <include>include <library>/boost//headers <library>/webcpp//boost_json
<library>/webcpp/config//config <library>/third_party//secp256k1
<toolset>emscripten:<define>BOOST_ASIO_DISABLE_THREADS
<toolset>emscripten:<linkflags>-lembind ;
alias parts : :
: : <include>include <library>/boost//headers <library>/webcpp/document//document
<library>/webcpp/config//config <library>/webcpp/asio//asio <library>/third_party//secp256k1 ;
alias trystero : : : : <library>parts
<toolset>emscripten,<webcpp-suspend>asyncify:<linkflags>"-sASYNCIFY_REMOVE=@\"$(WEBCPP_TRYSTERO_ROOT)/asyncify-remove.json\""
;
# end::trystero[]

# The native backend needs exceptions: libdatachannel reports errors by
# throwing, and data_channel.hpp and peer_connection.hpp catch them. Each
# headers-alone call, test and program of it declares
# <exception-handling>on itself, since b2 lets no usage requirement override
# a build's exception-handling=off.
# tag::native[]
alias native : : <conditional>@native-dependencies
: : <library>trystero <library>/webcpp/third_party//libdatachannel ;
# end::native[]
# The platform backend, one for both targets: its WebRTC is webcpp::webrtc's,
# its relays' WebSockets webcpp::beast's, their URLs read with Boost.URL,
# built from Boost's sources once per variant. Natively webcpp::webrtc brings
# the pinned libdatachannel and OpenSSL, and works with exceptions on and
# off, through libdatachannel's C API; so does the backend. Its relays run
# over the same OpenSSL (//tls), and webcpp::asio's //tls adds webcpp's
# embedded authorities, which a program may trust in place of the system's
# (make_tls_client_context). On emscripten webcpp::webrtc and webcpp::beast
# bind the page's RTCPeerConnection and WebSocket (//browser), and no
# OpenSSL is linked.
#
# platform is platform-parts and the rooms. platform-parts, the backend over
# parts, without the rooms' Asyncify list, is for trystero's tests of the
# backend's parts that parse no JSON (above).
# tag::platform[]
alias platform-parts : : <toolset>emscripten
: : <library>parts <library>/webcpp/webrtc//webrtc
<library>/webcpp/beast//browser <library>/webcpp//boost_url ;
alias platform-parts : : <conditional>@platform-dependencies
: : <library>parts <library>/webcpp/webrtc//webrtc
<library>/webcpp/beast//tls <library>/webcpp/asio//tls
<library>/webcpp//boost_url ;
alias platform : : : : <library>platform-parts <library>trystero ;
# end::platform[]
17 changes: 10 additions & 7 deletions doc/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ import webcpp ;

webcpp.doc trystero : trystero.adoc ;

# No single target builds every header: the browser backend's build only on
# No single target builds every header: a page's header builds only on
# emscripten, whose own headers hold only for wasm32's types, so the
# reference reads every header for Emscripten's target, as em++ compiles
# (/webcpp//emscripten-reference), with the native backend's target, which
# brings libdatachannel and OpenSSL, and the browser build's define of
# build.jam, which a requirement conditioned on the emscripten toolset does
# not give it.
webcpp.reference trystero : <library>/webcpp/trystero//native <threading>multi
<library>/webcpp//emscripten-reference <define>BOOST_ASIO_DISABLE_THREADS ;
# (/webcpp//emscripten-reference), with the platform backend's target, built
# natively, which brings webcpp::webrtc, webcpp::beast, Boost.URL,
# libdatachannel and OpenSSL. The platform backend's Asio and Beast are
# webcpp::asio and webcpp::beast, their browser implementations there, so it
# parses with no configuration of Boost.Asio's (measured: the page builds
# without BOOST_ASIO_DISABLE_THREADS, which Boost.Beast over Boost.Asio
# needed).
webcpp.reference trystero : <library>/webcpp/trystero//platform <threading>multi
<library>/webcpp//emscripten-reference ;
5 changes: 3 additions & 2 deletions doc/acknowledgements.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ trystero's own code, which is under the Boost Software License alone.

The BIP-340 signatures of the Nostr events are
https://github.com/bitcoin-core/secp256k1[libsecp256k1]'s, by the Bitcoin
Core contributors, under the MIT License. The native backend's WebRTC is
https://github.com/paullouisageneau/libdatachannel[libdatachannel]'s, by
Core contributors, under the MIT License. The platform backend's WebRTC is,
natively, webcpp::webrtc's over
https://github.com/paullouisageneau/libdatachannel[libdatachannel], by
Paul-Louis Ageneau, under the Mozilla Public License 2.0.
Loading
Loading