Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.Http.Http3QuicClient

Feature notes: HTTPS application layer notes (HTTP/1.1, h2, h3)

Classes, interfaces and records

classtHttp3QuicClient

An HTTP/3 client connection over a tQuicClient that you create and own, with its socket and TLS host; all three must outlive this adapter. Set up the QUIC client (certificate validation, server name, ALPN h3), create the adapter over it with your iHttp3ClientObserver, then call QUIC.Start. Then loop: Pump(now), and wait until the socket is readable or the NextWakeup deadline is due. Pump reads the socket, starts HTTP/3 once the handshake is authenticated with h3, delivers input to the observer and flushes output, so do not poll QUIC yourself. Pass one monotone microsecond clock; a Pump time lower than the last one raises. One Pump delivers a bounded amount of input: while more is waiting, StreamWorkPending is True and NextWakeup returns aNowMicros. Once Ready, call StartRequest; the request and body methods forward to Engine and are described on tHttp3ClientConn. Call ReleaseBody for consumed body bytes after the callback has returned. Calls must come from one thread at a time (there is no lock) and never from an observer callback, which raises. Engine is owned and freed by the adapter; use it for status and counters. To finish, close the QUIC client (a later Pump reports ConnectionFailed), then free the adapter before the QUIC client. For 0-RTT see CaptureResumptionTicket.

constructor Create(aQuic: tQuicClient; const aObserver: iHttp3ClientObserver); overload; constructor Create(aQuic: tQuicClient; const aObserver: iHttp3ClientObserver; const aLimits: tHttp3ClientLimits); overload; destructor Destroy; override; function CaptureResumptionTicket(aTicket: TTls13ClientTicket): tQuicSessionTicket;
0-RTT takes two connections. On the first, pass the ticket from the TLS OnNewSessionTicket event to CaptureResumptionTicket, also from inside that event. Full description »
function ConfigureEarlyData(aTicket: tQuicSessionTicket; aNow: TDateTime): Boolean; procedure Pump(aNowMicros: UInt64); function NextWakeup(aNowMicros: UInt64; out aDeadline: UInt64): Boolean;
When Pump must next run if no datagram arrives: aDeadline is the earliest QUIC timer (or push expiry), or aNowMicros while input is still waiting (StreamWorkPending), in the clock you pass to Pump. Wait for socket readability or that time, whichever comes first. False: nothing is timed (aDeadline is 0); wait for the socket only.
function StreamWorkPending: Boolean;
True while HTTP/3 is running over an active, authenticated connection and received stream work remains for the next Pump. A query without side effects, for owners that decide how long to wait.
function StartEarlyRequest(const aMethod, aScheme, aAuthority, aPath: string; const aHeaders: tQpackFields; const aBody: TBytes): UInt64;
A 0-RTT request with a complete body, after a successful ConfigureEarlyData. Allowed while EarlyReady is True - from QUIC.Start until the handshake completes - and raises otherwise; EarlyReady only reports and starts nothing. Full description »
function StartRequest(const aMethod, aScheme, aAuthority, aPath: string; const aHeaders: tQpackFields; const aBody: TBytes): UInt64; overload; function StartRequest(const aMethod, aScheme, aAuthority, aPath: string; const aHeaders: tQpackFields; const aBody: TBytes; aEndStream: Boolean): UInt64; overload; function RequestBodyOpen(aStreamID: UInt64): Boolean; function RequestBodyCapacity(aStreamID: UInt64): Integer; function TrySendBody(aStreamID: UInt64; const aData: TBytes; aEndStream: Boolean): Boolean; function TrySendTrailers(aStreamID: UInt64; const aTrailers: tHttpHeaders): Boolean; procedure ReleaseBody(aStreamID, aCount: UInt64); procedure ReleasePushBody(aPushID, aCount: UInt64);
Deprecated - server push only.
procedure CancelPush(aPushID: UInt64);
Deprecated - server push only.
procedure BeginPushDrain(aFirstRejectedPushID: UInt64);
Deprecated - server push only.
procedure Cancel(aStreamID: UInt64); property Ready: Boolean read GetReady; property EarlyReady: Boolean read GetEarlyReady; property Engine: tHttp3ClientConn read fEngine;