sgcHTTPHTTP server, HTTP/2and 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.
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.
Create the HTTP/2 clientCreate a TsgcHTTP2Client, handle OnHTTP2Response and call Get. The h2 protocol is negotiated during the TLS handshake through ALPN.
Many requests, one connectionRequests share a single TCP connection as independent streams, so one slow response does not block the others behind it.
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.
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.
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.
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.
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.
Point it at a hostAn https:// host is all it takes. ALPN negotiates h2 during the TLS handshake, and HPACK compresses the headers.
Hook the response eventOnHTTP2Response and OnGRPCResponse hand you the decoded body, with the request and connection attached.
Send, synchronously or notEvery verb and every RPC has a blocking call and an Async twin, so the UI thread stays free.
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 sgcCustomIndyTsgcHTTPServerno, ships with the Core runtimeTsgcHTTP2Clientyes, for ALPNTsgcGRPCClientyes, rides on TsgcHTTP2ClientTsgcHTTPGoogleCloud_PubSub_Clientno, plain HTTPSTsgcHTTPGoogleCloud_Calendar_Clientno, plain HTTPSTsgcHTTPGoogleCloud_FCM_Clientno, plain HTTPSHTTP/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.
ALPN
HPACK
Protocol Buffers
Service account JWT
Full source
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.
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 MorettiDelphi Developer
sgcWebSockets is amazing and your support is the best!
Christian MeyerFounder & CTO
Thanks so much for your help and support, I love your components.
Mark SteinfeldCTO
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.
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.