docs(listener): ListenerQUIC::Port(), and port 0 for tests
The README gains a QUIC section, which it never had: plain QUIC under an ALPN of your own, starting with a listener on port 0 and Port(). The consumer notes describe Port() and point tests at port 0 rather than at binding a socket by hand; the agent notes count the new test and make port 0 the default for a new one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3457ff08ce
commit
fdb0ac2524
3 changed files with 22 additions and 4 deletions
18
README.md
18
README.md
|
|
@ -85,6 +85,23 @@ std::thread([&] { broker.ListenSyncSync(); }).detach();
|
|||
// ... broker.Stop() ends the loop from another thread.
|
||||
```
|
||||
|
||||
### QUIC Components
|
||||
|
||||
Plain QUIC under an ALPN of your own, for a protocol that is not HTTP. A browser cannot reach these: it speaks QUIC only as WebTransport, see [WebTransport Components](#webtransport-components).
|
||||
|
||||
#### ListenerQUIC
|
||||
```cpp
|
||||
Crafter::QUICServerCredentials creds;
|
||||
creds.selfSigned = true; // dev-only, see "Self-signed certs & browser peers"
|
||||
Crafter::ListenerQUIC listener(0, "myproto/1", creds, [](Crafter::ClientQUIC* peer) {
|
||||
// An accepted connection, heap-allocated and yours to delete.
|
||||
});
|
||||
listener.ListenAsyncAsync();
|
||||
const std::uint16_t port = listener.Port(); // the port msquic picked for port 0
|
||||
```
|
||||
|
||||
`Port()` reports the UDP port the listener is bound to, so port 0 is usable: the listener takes whatever port is free and tells you which.
|
||||
|
||||
### HTTP/3 Components
|
||||
|
||||
HTTP/3 runs over QUIC, which always requires TLS. Pass server credentials when constructing the listener (or set `selfSigned = true` for a development-only ephemeral cert) and matching client credentials when constructing the client (`insecureNoServerValidation = true` for self-signed servers).
|
||||
|
|
@ -316,6 +333,7 @@ The library includes tests covering:
|
|||
- HTTP/3 external interop (`ShouldSend`) — live fetch from `cloudflare-quic.com:443`, exercises real TLS chain validation, mandatory control stream, peer-initiated unidi streams, and QPACK Huffman decoding
|
||||
- QUIC reliable streams (`ShouldSendRecieveQUICStream`)
|
||||
- QUIC unreliable datagrams (`ShouldSendRecieveQUICDatagram`)
|
||||
- QUIC listener ports (`ShouldReportListenerPortQUIC`) — a listener on port 0 reports the port it got and is reachable there, a second one gets another, and a fixed port reads back as itself
|
||||
- QUIC connection teardown (`ShouldSurviveConnectionChurn`) — 25 build-up/tear-down cycles with reader threads parked inside `RecieveSync`, the shape a reconnect loop has; the rest of the QUIC tests end in `std::_Exit(0)` and so never run a `ClientQUIC` destructor
|
||||
- WebTransport echo (`ShouldEchoWebTransport`) — extended-CONNECT acceptance, draft-02 SETTINGS, bidi data stream framing (`WT_STREAM 0x41` + session-id varint), and byte-for-byte echo
|
||||
- HTTP/1.1 wire format (`ShouldParseHTTP1`) — serialisation, incremental parsing fed one byte at a time, chunked bodies with trailers, pipelining, interim 1xx, HTTP/1.0 and HEAD framing, and the malformed inputs the parser is required to reject
|
||||
|
|
|
|||
Loading…
Reference in a new issue