docs(listener): ListenerQUIC's bind address, and how msquic enforces it
The README's QUIC section and the consumer notes show the new constructor and say what binding an address means under msquic: the UDP port is bound on every address anyway, and a connection sent to another one is refused during its first flight (0x5c, in milliseconds), so a client of a 127.0.0.1 listener dials 127.0.0.1, not `localhost`. The agent notes' family gotcha says the same and counts the new test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a50e3f415c
commit
5068f0acd7
3 changed files with 10 additions and 3 deletions
|
|
@ -102,6 +102,12 @@ 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.
|
||||
|
||||
The port-only constructor listens on every address of both families. To keep a listener to this machine, name the address first, as with `ListenerTCP`; it must be numeric (`127.0.0.1`, `::1`, `0.0.0.0`, `::`), and a name such as `localhost` is refused. msquic still binds the UDP port on every address, but turns away a connection sent to any other address of the machine during its first flight, so such a client fails at once rather than at its handshake timeout. A client of a listener on `127.0.0.1` must dial `127.0.0.1`: `::1` is another address.
|
||||
|
||||
```cpp
|
||||
Crafter::ListenerQUIC local("127.0.0.1", 0, "myproto/1", creds, onConnect);
|
||||
```
|
||||
|
||||
### 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).
|
||||
|
|
@ -334,6 +340,7 @@ The library includes tests covering:
|
|||
- 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 loopback listeners (`ShouldBindLoopbackQUIC`) — a listener on `127.0.0.1` serves loopback clients and refuses, at once, clients through the host's LAN address or `::1`; `::1` works too, and a name is refused
|
||||
- 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