HTTP/2 Protocol
Native HTTP/2 client and server for Delphi and C++Builder. Binary framing, stream multiplexing, HPACK header compression and ALPN negotiation — no IIS, Apache or Indy dependency.
Native HTTP/2 client and server for Delphi and C++Builder. Binary framing, stream multiplexing, HPACK header compression and ALPN negotiation — no IIS, Apache or Indy dependency.
Two production-ready components implement the full HTTP/2 (RFC 9113) wire protocol. Use the client to consume HTTP/2 APIs, use the server to publish them — or both inside the same application.
Native HTTP/2 client — multiplexed GET/POST/PUT/DELETE over a single TLS connection, HPACK-compressed headers, ALPN h2 upgrade or prior-knowledge h2c, server-push handling and bearer / basic / NTLM authentication.
Native HTTP/2 server — the same WebSocket HTTP server serves HTTP/1.1, HTTP/2 (h2) and WebSocket on one TLS port. ALPN negotiation, stream multiplexing, HPACK responses and optional RFC 8441 WebSocket-over-HTTP/2 bootstrap.
A first-class implementation of HTTP/2 framing wired into both the client and the WebSocket HTTP server.
TsgcHTTP2ClientTsgcWebSocketHTTPServer
Windows, macOS, Linux, iOS, Android
Client: Standard / Pro / Enterprise
Server: Pro / Enterprise
All the wins of HTTP/2 over HTTP/1.1 — in native Delphi/C++Builder code, without spawning a separate web server.
Requests and responses are split into binary frames, parsed by a deterministic state machine. No more text-line parsing or HTTP/1.1 ambiguity.
Dozens of in-flight requests share a single TCP/TLS connection — no head-of-line blocking at the HTTP layer, no extra sockets per request.
Built-in HPACK encoder/decoder (RFC 7541). Repeated cookies, auth tokens and content-type headers cost almost zero bytes after the first request.
During the TLS handshake the peer advertises h2 and http/1.1; the negotiated ALPN value selects the protocol with no round-trips wasted.
For trusted internal links and service-mesh sidecars, both sides can skip ALPN and start HTTP/2 over plaintext via HTTP2_PriorKnowledge.
The server may proactively send PUSH_PROMISE responses; the client surfaces them through OnHTTP2StreamData for caching. Note: deprecated on the public web, still useful internally.
Per-stream priority and dependency hints let critical responses (auth, navigation, JSON-RPC results) overtake bulk transfers on the same connection.
Per-stream and per-connection WINDOW_UPDATE flow control prevents one large response from starving smaller ones — tunable through SETTINGS frames.
Set TLSOptions.IOHandler to iohSChannel for Windows kernel TLS (no DLLs) or iohOpenSSL for full cross-platform 1.2/1.3 support.
Drop-in scenarios where the multiplexing and HPACK savings of HTTP/2 pay for themselves immediately.
Apple's APNs provider API requires HTTP/2. TsgcHTTP2Client drives the Apple Push component end-to-end with token-based auth.
Google's FCM HTTP v1 API runs over HTTP/2. Same component powers FCM with service-account JWT minting.
Most cloud APIs (Stripe, GitHub, Cloudflare, Google, Azure…) speak HTTP/2 by default — multiplexed clients cut latency on parallel calls.
Internal microservices behind a sidecar mesh use HTTP/2 prior-knowledge (h2c) to multiplex hundreds of RPC streams over one socket.
TsgcWebSocketHTTPServer serves HTTP/1.1, HTTP/2 and WebSocket on a single TLS endpoint — ALPN routes each connection automatically.
For clients that prefer to tunnel WebSocket frames inside HTTP/2 streams, enable Specifications.RFC8441 on the server.
Drop the component, set TLS, go. ALPN negotiates h2 for you during the handshake.
uses
sgcHTTP, sgcHTTP2;
var
HTTP2: TsgcHTTP2Client;
begin
HTTP2 := TsgcHTTP2Client.Create(nil);
HTTP2.TLSOptions.IOHandler := iohSChannel; // or iohOpenSSL
HTTP2.TLSOptions.Version := tls1_2;
// Add custom headers (compressed by HPACK)
HTTP2.Request.CustomHeaders.Add('authorization: Bearer eyJ...');
// GET over HTTP/2 (ALPN negotiates h2)
Memo1.Text := HTTP2.Get('https://api.example.com/v1/items');
ShowMessage(IntToStr(HTTP2.Response.Status));
end;
uses
sgcWebSocket;
var
Server: TsgcWebSocketHTTPServer;
begin
Server := TsgcWebSocketHTTPServer.Create(nil);
Server.Port := 443;
Server.SSL := True;
Server.SSLOptions.CertFile := 'cert.pem';
Server.SSLOptions.KeyFile := 'key.pem';
// HTTP/1.1, HTTP/2 and WebSocket on the same TLS port
Server.Specifications.HTTP := True;
Server.Specifications.HTTP2 := True;
Server.Specifications.RFC6455 := True;
Server.Active := True;
end;
// uses: sgcHTTP, sgcHTTP2
TsgcHTTP2Client *HTTP2 = new TsgcHTTP2Client(this);
HTTP2->TLSOptions->IOHandler = iohSChannel;
HTTP2->Request->CustomHeaders->Add("authorization: Bearer eyJ...");
Memo1->Text = HTTP2->Get("https://api.example.com/v1/items");
Deep-link to the component pages, online help and the ready-to-run demo project shipped inside the trial.
| HTTP/2 Client — TsgcHTTP2Client Component page: features, code samples and TLS options for the client. | Open | |
| HTTP/2 Server — TsgcWebSocketHTTPServer Component page: how to enable HTTP/2 alongside HTTP/1.1 and WebSocket on one TLS port. | Open | |
| Online Help — HTTP/2 Full property, method and event reference for HTTP/2 components. | Open | |
| Demo Project — Demos\20.HTTP_Protocol\01.HTTP2_Server_And_Client Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |