sgcHTTP HTTP server, HTTP/2 and gRPC in Delphi. Google Cloud too.

An HTTP server and five client components. TsgcHTTPServer publishes HTTP endpoints and static files from your own application. TsgcHTTP2Client speaks HTTP/2 with multiplexed streams over one TLS connection and HPACK header compression. TsgcGRPCClient is a gRPC client built on top of it, for unary and streaming Protocol Buffers calls. Three more classes reach Google Cloud over plain HTTPS: Pub/Sub, Calendar and Firebase Cloud Messaging.

A standalone package of sgcWebSockets, Core runtime bundled in. See pricing →
  • HTTP server
  • HTTP/2
  • gRPC
  • Google Cloud
  • HPACK & ALPN
  • Delphi 7 to 13
  • C++ Builder
  • 3Palette components: the HTTP server, the HTTP/2 client and the gRPC client
  • 5Client classes in total
  • 3Google Cloud services: Pub/Sub, Calendar and FCM
  • 1Standalone installer, Core runtime bundled in
  • 100%Source code included with every license
Watch it run

See sgcHTTP in two minutes.

A narrated, captioned quickstart: an HTTP/2 client sending many requests over one connection, then a gRPC call riding on that same transport, all from Delphi. Nothing downloads until you press play.

sgcHTTP quickstart

Call an HTTP/2 endpoint and make a gRPC call, from Delphi.

  1. Create the HTTP/2 clientCreate a TsgcHTTP2Client, handle OnHTTP2Response and call Get. The h2 protocol is negotiated during the TLS handshake through ALPN.
  2. Many requests, one connectionRequests share a single TCP connection as independent streams, so one slow response does not block the others behind it.
  3. gRPC on the same transportAssign the HTTP/2 client to the gRPC client and call a method by service and name. Messages travel as length-prefixed Protocol Buffers.
  4. Four RPC patternsUnary, server streaming, client streaming and bidirectional streaming, each with its own method on TsgcGRPCClient.
Two palette components

An HTTP/2 client, and gRPC riding on it.

Both components are declared in the sgcHTTP unit, and TsgcGRPCClient carries its own HTTP/2 connection through its Client property.

The HTTP/2 client in the sgcHTTP quickstart: the Delphi code next to six requests in flight over one socket

Multiplexed streams over one TLS connection

TsgcHTTP2Client speaks HTTP/2 (RFC 9113): multiple requests share a single TCP connection as independent streams. Headers are compressed with HPACK, and h2 is negotiated during the TLS handshake through ALPN. Every verb is covered, Get, Post, Put, Patch, Delete and Options, each with a synchronous call and an Async twin.

gRPC in the sgcHTTP quickstart: a TsgcGRPCClient using a TsgcHTTP2Client as its transport, with the four RPC patterns listed

Unary and streaming RPC on the HTTP/2 client

TsgcGRPCClient inherits the multiplexed connection and adds the gRPC wire format on top. Call and CallAsync cover unary RPCs, ServerStreamingCall handles a stream of responses to one request, and OpenClientStream and OpenBidiStream cover client streaming and bidirectional streaming. RetryPolicy, Interceptors and ServiceConfig add retry behavior and cross-cutting logic without touching the call sites.

One server, five client classes

Two dependencies, not five.

The five classes split cleanly by what they need underneath. HTTP/2 and gRPC need ALPN, which means sgcCustomIndy. Google Cloud needs nothing beyond HTTPS and a service account, which the bundled Core runtime already provides. The HTTP server comes from that runtime itself.

HTTP server

TsgcHTTPServer publishes HTTP endpoints from your own application. Set Port, handle OnCommandGet, set Active, and every request reaches your code. OnCommandOther covers verbs such as PUT and DELETE. It ships with the bundled Core runtime.

Static files and uploads

Point DocumentRoot at a folder and the server returns static files from it. HTTPUploadFiles saves uploaded files to disk, MaxRequestBodySize caps request bodies, and HTTPCompression and KeepAlive keep responses small and connections open.

Ready for production

SSL and SSLOptions enable TLS, Authentication and OnAuthentication protect endpoints, SessionState tracks sessions, and ThreadPool and MaxConnections control how it scales. The same engine as the WebSocket server, without the WebSocket part.

HTTP/2

TsgcHTTP2Client multiplexes independent streams over one TLS connection, compresses headers with HPACK and negotiates h2 through ALPN. Connect, Get, Post, Put, Patch, Delete and Options, synchronous or Async.

gRPC

TsgcGRPCClient rides on the HTTP/2 client: length-prefixed Protocol Buffers messages over HTTP/2 streams, with unary, server streaming, client streaming and bidirectional RPCs, plus retry policy and interceptors.

Google Cloud, plain HTTPS

TsgcHTTPGoogleCloud_PubSub_Client, TsgcHTTPGoogleCloud_Calendar_Client and TsgcHTTPGoogleCloud_FCM_Client reach Pub/Sub, Calendar and Firebase Cloud Messaging, authenticated with a Google service account. None of them need sgcCustomIndy.

Server push and chunked bodies

Events surface the connection lifecycle: OnHTTP2Connect, OnHTTP2Response, OnHTTP2ResponseFragment for chunked bodies, OnHTTP2PushPromise for server push, OnHTTP2GoAway and OnHTTP2Disconnect. Nothing about the stream lifecycle is hidden from you.

One dependency for two, none for three

The HTTP/2 and gRPC clients build on sgcCustomIndy, which covers the same platform range as sgcWebSockets itself. The Google Cloud clients are plain HTTPS, so they run wherever the Core runtime does. Delphi 7 through RAD Studio 13, and C++ Builder.

Full source in the box

Every license carries the full source of the HTTP server, all five clients and the bundled runtime, so the wire-level implementations step through in your own debugger. Deployment is royalty-free.

The code

HTTP server, HTTP/2 and gRPC, side by side.

Create the component, set a port or point it at a host, hook the event and go. The same code compiles in Delphi 7 to 13 and C++ Builder.

uses
  sgcHTTP;
var
  HTTP2: TsgcHTTP2Client;
begin
  // HTTP/2: multiplexed requests over one TLS connection
  HTTP2 := TsgcHTTP2Client.Create(nil);
  HTTP2.Host := 'https://api.example.com';
  HTTP2.OnHTTP2Response := HTTP2Response;
  HTTP2.Active := True;

  HTTP2.GetAsync('/v1/status');
end;

procedure TForm1.HTTP2Response(Sender: TObject;
  const Connection: TsgcHTTP2ConnectionClient;
  const Request: TsgcHTTP2RequestProperty;
  const Response: TsgcHTTP2ResponseProperty);
begin
  Memo1.Lines.Add(Response.DataString);
end;
uses
  sgcHTTP;
var
  GRPC: TsgcGRPCClient;
begin
  // gRPC: built on the HTTP/2 client, unary and streaming RPC
  GRPC := TsgcGRPCClient.Create(nil);
  GRPC.Client.Host := 'https://grpc.example.com';
  GRPC.OnGRPCResponse := GRPCResponse;

  GRPC.CallAsync('example.OrderService', 'GetOrder', RequestBytes);
end;

procedure TForm1.GRPCResponse(Sender: TObject;
  const aResponse: TsgcGRPCResponse);
begin
  Memo1.Lines.Add(aResponse.DataString);
end;
uses
  sgcHTTP_Server;
var
  Server: TsgcHTTPServer;
begin
  // HTTP server: endpoints and static files
  Server := TsgcHTTPServer.Create(nil);
  Server.Port := 8080;
  Server.DocumentRoot := 'C:\www';
  Server.OnCommandGet := ServerCommandGet;
  Server.Active := True;
end;

procedure TForm1.ServerCommandGet(AContext: TIdContext;
  ARequestInfo: TIdHTTPRequestInfo;
  AResponseInfo: TIdHTTPResponseInfo);
begin
  if ARequestInfo.Document = '/api/status' then
  begin
    AResponseInfo.ContentType := 'application/json';
    AResponseInfo.ContentText := '{"status":"ok"}';
  end;
end;
  1. Create the clientThe clients live in the sgcHTTP unit, the server in sgcHTTP_Server. TsgcGRPCClient carries its own HTTP/2 connection through its Client property.
  2. Point it at a hostAn https:// host is all it takes. ALPN negotiates h2 during the TLS handshake, and HPACK compresses the headers.
  3. Hook the response eventOnHTTP2Response and OnGRPCResponse hand you the decoded body, with the request and connection attached.
  4. Send, synchronously or notEvery verb and every RPC has a blocking call and an Async twin, so the UI thread stays free.

The same shape in Object Pascal and in C++ Builder. The full feature matrix →

Before you buy

Two things worth knowing first.

What sgcHTTP needs from you, and what it does not. Both answers are short, and both are on this page rather than in the small print.

Dependencies per component
class                               needs sgcCustomIndy
TsgcHTTPServer                      no, ships with the Core runtime
TsgcHTTP2Client                     yes, for ALPN
TsgcGRPCClient                      yes, rides on TsgcHTTP2Client
TsgcHTTPGoogleCloud_PubSub_Client   no, plain HTTPS
TsgcHTTPGoogleCloud_Calendar_Client no, plain HTTPS
TsgcHTTPGoogleCloud_FCM_Client      no, plain HTTPS

HTTP/2 negotiates h2 with ALPN during the TLS handshake.
  The standard Indy library that ships with RAD Studio
  has no ALPN support, so both HTTP/2 and gRPC are built
  on sgcCustomIndy instead.

sgcHTTP is standalone

The sgcWebSockets Core runtime is included: the HTTP server, the HTTP/TLS client stack every client sends its requests through, and the JSON layer that decodes Google Cloud responses. One installer, full source code in the box.

HTTP/2 and gRPC need sgcCustomIndy

ALPN negotiation is not supported by the standard Indy library, so TsgcHTTP2Client and, by extension, TsgcGRPCClient are built on sgcCustomIndy instead. It is always included when you order sgcHTTP, and the price shown already covers it.

Google Cloud needs only HTTPS

The three Google Cloud clients authenticate with a Google service account's project id, client email and private key, and call the REST APIs over the Core runtime's plain HTTPS stack. No native library, no sgcCustomIndy.

Delphi and C++ Builder

sgcHTTP targets Delphi 7 through RAD Studio 13 and C++ Builder. The same components also live inside sgcWebSockets Enterprise, so an existing Enterprise or All-Access license may already cover you. The trial installer is the sgcWebSockets All-Access trial, so the HTTP server and all five clients can be evaluated today.

sgcHTTP implements the published HTTP/2, gRPC and Google Cloud REST surfaces rather than wrapping a vendor SDK, so streams, headers, RPCs and push notifications are all first-class methods and events, and full source code means nothing in between is a black box.

Part of sgcWebSockets

A single package of sgcWebSockets, licensed on its own.

sgcHTTP bundles the sgcWebSockets Core runtime it is built on, and the sgcCustomIndy add-on that HTTP/2 and gRPC need is always included. Every license ships with full source code and royalty-free deployment.

Single

1 developer license. Use on one machine at a time.

€398

Team

2 developer licenses. Use on two machines at a time.

€648

Site

Unlimited developers. All company machines.

€1,048

HTTP/2, gRPC and Google Cloud client components for Delphi and C++ Builder, with the sgcWebSockets Core runtime bundled in. Already on sgcWebSockets Enterprise? The same components are in there too.

View pricing and licenses
Testimonials

What Developers Say

Trusted by Delphi, C++ Builder, Lazarus and .NET developers around the world.

Your sgcWebSockets library is very useful and easy to setup. Keep up the good work!
Simone Moretti Delphi Developer
sgcWebSockets is amazing and your support is the best!
Christian Meyer Founder & CTO
Thanks so much for your help and support, I love your components.
Mark Steinfeld CTO

Modern HTTP, gRPC and Google Cloud from native code.

An HTTP server, multiplexed HTTP/2, streaming gRPC and three Google Cloud clients, with the sgcWebSockets Core runtime bundled in and full source code in the box.

More From eSeGeCe

Other Products by eSeGeCe

sgcHTTP shares conventions with the other eSeGeCe component libraries for Delphi, C++ Builder and .NET. They ship with full source, and they deploy royalty-free.

sgcWebSockets

WebSocket, HTTP/2, MQTT, AMQP, WebRTC, AI and 30+ API integrations for Delphi, C++ Builder, Lazarus and .NET. Its Enterprise edition includes gRPC too.

sgcREST

REST server, OpenAPI server and OpenAPI client components for Delphi and C++ Builder. Publish REST APIs from an OpenAPI 3.x contract, or consume any OpenAPI-described API.

sgcAuth

OAuth2 client, JWT client and WebAuthn support for Delphi and C++ Builder. Standalone, with the sgcWebSockets Core runtime bundled in.

sgcMQ

MQTT, AMQP 0.9.1 and 1.0, Apache Kafka and STOMP client components for Delphi and C++ Builder. Standalone, with the sgcWebSockets Core runtime bundled in.

sgcSocial

Telegram and WhatsApp Business client components for Delphi and C++ Builder. Standalone, with the sgcWebSockets Core runtime bundled in.

sgcAI

AI, LLM and MCP components for Delphi and C++ Builder. Seven LLM providers behind one component, plus MCP, embeddings and speech.

sgcHTML

Server-side HTML and UI components on Bootstrap 5 and htmx for Delphi, C++ Builder and .NET.

sgcQUIC

Raw QUIC transport and an HTTP/3 client and server, with WebTransport. An add-on to sgcWebSockets Enterprise.

sgcOpenAPI

OpenAPI 3.x parser, native Pascal SDK generator, OpenAPI server component, and 1,195+ pre-built cloud SDKs.

sgcSign

XAdES, PAdES, CAdES and ASiC for documents, Authenticode, ClickOnce, NuGet and VSIX for code.

sgcPDF

Create, edit, view, sign, redact and validate PDF files in pure Object Pascal, with no DLL to deploy. Licensed on its own.

sgcBiometrics

Windows Hello, fingerprint sensors and the Windows Biometric Framework for Delphi and C++ Builder.

sgcIndy

Updated Indy TCP/IP components with modern TLS, IPv6 and HTTP/2 for Delphi 7 through 13.

Latest from the blog

View all posts →

You are seeing the HTTP server, HTTP/2 & gRPC view of eSeGeCe.

Show me another angle →
30-Day Money-Back GuaranteeNot satisfied? Request a full refund within 30 days of purchase. See refund policy