sgcHTTP Feature Matrix

Everything sgcHTTP does, mapped across the HTTP server, the FastCGI / SCGI gateway, the HTTP/2 client, the gRPC client and the three Google Cloud clients. Every capability works the same in Delphi and C++ Builder, and every license ships full source code. Component subpages are not published yet for this launch, each entry below is self-contained on this page.

HTTP Server

Endpoints, static files, sessions, TLS

FastCGI / SCGI Gateway

PHP & Python behind your server

HTTP/2 Client

Multiplexed streams, HPACK, ALPN

gRPC Client

Unary & streaming RPC

Google Cloud

Pub/Sub, Calendar & FCM

Standards & Platforms

Delphi 7 to 13, C++ Builder

sgcHTTP is self-contained. It ships with the sgcWebSockets Core runtime bundled in, so it is not an add-on. The HTTP server, TsgcHTTPServer, is part of that runtime.

HTTP/2 and gRPC need sgcCustomIndy. Both classes require ALPN for TLS protocol negotiation, which the standard Indy library does not support, so they are built on sgcCustomIndy instead. It is always included in your order, and the sgcHTTP price shown already covers it. The three Google Cloud clients are plain HTTPS and do not need it. Neither does the FastCGI / SCGI gateway, which works with the standard Indy that ships with RAD Studio.

Seven Classes, Three Units

Four components on the SGC HTTP palette page and three code-only Google Cloud classes. The HTTP server is declared in the sgcHTTP_Server unit of the bundled Core runtime, the FastCGI / SCGI gateway in the sgcHTTP_Gateway unit, everything else in the sgcHTTP unit.

ComponentClassPalette?Description
HTTP ServerTsgcHTTPServerYesHTTP server: request events, static files from a document root, compression, keep-alive, sessions, uploads, TLS and authentication. Ships with the Core runtime.
FastCGI / SCGI GatewayTsgcHTTPGatewayYesForwards requests received by the HTTP server to FastCGI and SCGI application servers over TCP, such as PHP-FPM or a Python SCGI server. Unit sgcHTTP_Gateway. Standard Indy, no sgcCustomIndy needed.
HTTP/2 ClientTsgcHTTP2ClientYesNative HTTP/2 client: multiplexed streams, HPACK header compression, ALPN negotiation. Needs sgcCustomIndy.
gRPC ClientTsgcGRPCClientYesgRPC client built on the HTTP/2 client: unary, server-streaming, client-streaming and bidirectional RPC. Needs sgcCustomIndy.
Google Cloud Pub/SubTsgcHTTPGoogleCloud_PubSub_ClientNo, code-onlyGoogle Cloud Pub/Sub REST API: topics, subscriptions, snapshots, publish and pull. Plain HTTPS on Core.
Google Cloud CalendarTsgcHTTPGoogleCloud_Calendar_ClientNo, code-onlyGoogle Calendar API v3: calendars and events, create, update, list, delete. Plain HTTPS on Core.
Google Cloud FCMTsgcHTTPGoogleCloud_FCM_ClientNo, code-onlyFirebase Cloud Messaging HTTP v1 API: send a push notification payload with one call. Plain HTTPS on Core.

Endpoints, Static Files, Sessions

TsgcHTTPServer publishes HTTP endpoints and static files from your own application. It is the same engine as the sgcWebSockets WebSocket server without the WebSocket part, and it ships with the bundled Core runtime.

CapabilityAPINotes
ListeningPort, Bindings, ActiveSet the port, or bind to specific addresses, then activate the server.
RequestsOnCommandGet, OnCommandOtherEvery request reaches your code with its request and response objects. OnCommandOther covers verbs such as PUT and DELETE.
Static filesDocumentRootReturns static files from the folder you point it at.
CompressionHTTPCompressionResponse compression options.
ConnectionsKeepAlive, MaxConnectionsKeep connections open between requests, and cap how many are open at once.
SessionsSessionState, AutoStartSession, SessionTimeOut, OnSessionStart, OnSessionEndServer-side sessions with a timeout, plus start and end events.
Request limitsMaxRequestBodySizeCaps the size of a request body.
UploadsHTTPUploadFilesSaves uploaded files to a directory you choose.
TLSSSL, SSLOptionsServe HTTPS with your own certificate.
AuthenticationAuthentication, OnAuthenticationValidate credentials in your own code before a request is served.
ThreadsThreadPool, ThreadPoolOptionsReuse worker threads from a pool instead of creating one per connection.
RuntimesgcWebSockets CoreDeclared in the sgcHTTP_Server unit of the bundled Core runtime, on the SGC HTTP palette page.

PHP and Python Applications Behind Your Server

TsgcHTTPGateway forwards requests received by TsgcHTTPServer or TsgcWebSocketHTTPServer to FastCGI and SCGI application servers over TCP. It does the job of Apache mod_proxy_fcgi and mod_proxy_scgi or nginx fastcgi_pass and scgi_pass, so PHP and Python applications are served from your Delphi server with no Apache or nginx in front.

CapabilityAPINotes
BackendsFastCGI, SCGIPHP through PHP-FPM or php-cgi -b, and Python applications served by an SCGI or FastCGI server, for example flup.
RequestsProcessCall it from the server's OnCommandGet and OnCommandOther events. It returns true when a handler matched and the response is filled, and false when your own code answers the request.
HandlersHandlers.AddHandlers.Add('*.php', 'fcgi://127.0.0.1:9000') or Handlers.Add('/app/', 'scgi://127.0.0.1:4000'). A handler matches by extension (*.php), by prefix (/app/) or by exact path.
Handler settingsPath, URL, Protocol, Host, Port, DocumentRoot, EnabledPoint each handler at its backend with one URL, or with protocol, host and port, and set the backend's document root.
CGI environmentSCRIPT_NAME, PATH_INFO, SCRIPT_FILENAME, QUERY_STRING, REMOTE_ADDR, HTTPSBuilt following RFC 3875, with every request header passed as an HTTP_* variable.
Extra variablesEnvironment, OnBeforeRequestAdd variables per handler through Environment, or per request in OnBeforeRequest.
ResponsesCGI responseParses the Status header, Location redirects, the response headers and the body. Several Set-Cookie headers are all kept.
Gateway errorsOnError502 Bad Gateway, 503 Service Unavailable when the FastCGI backend is overloaded, and 504 Gateway Timeout, each reported in OnError.
Backend errorsOnStdErrDelivers the stderr output the FastCGI backend sends.
ConnectionsConnectTimeout, ReadTimeout, KeepAlive, MaxIdleConnectionsTimeouts per handler, plus an optional keep-alive connection pool for FastCGI (FCGI_KEEP_CONN), off by default. SCGI opens one connection per request.
FastCGI roleResponderThe FastCGI Responder role. Requests are not multiplexed on a connection.
SecurityBuilt inA Proxy request header is never passed as HTTP_PROXY (httpoxy), paths containing .. are rejected with 403, and header names with underscores are ignored.
LimitationsTCP, bufferedTCP backends only, Unix-domain sockets are not supported yet. The backend process must already be running, the gateway does not start it. Responses are buffered, so streaming such as server-sent events is not supported.
DependencyStandard IndyWorks with the Indy library that ships with RAD Studio, no sgcCustomIndy needed. Windows and Linux.
Unit & demosgcHTTP_GatewayOn the SGC HTTP palette page. The demo is in Demos\20.HTTP_Protocol\18.FastCGI_SCGI_Gateway.

Multiplexed Requests, HPACK, ALPN

TsgcHTTP2Client speaks HTTP/2 (RFC 9113) over a single TLS connection, negotiated with ALPN, which is why it is built on sgcCustomIndy.

CapabilityAPINotes
ConnectionHost, Port, ActiveOne TLS connection carries every multiplexed request stream.
ConnectConnect, ConnectAsyncOpens the connection and issues an optional request in the same call.
ReadGet, GetAsyncSynchronous call or fire-and-forget with the response delivered by event.
WritePost, PostAsync, Put, PutAsync, Patch, PatchAsyncRequest bodies are streams, so uploads do not have to fit in memory.
Delete & OptionsDelete, DeleteAsync, Options, OptionsAsyncThe rest of the HTTP verb set, same synchronous/async pairing.
ResponsesOnHTTP2ResponseDelivers the request and response objects together, including Response.DataString and status.
Chunked bodiesOnHTTP2ResponseFragmentFires as each fragment of a chunked response arrives, ahead of the final OnHTTP2Response.
Server pushOnHTTP2PushPromiseSurfaces HTTP/2 server-pushed resources as they arrive.
Connection lifecycleOnHTTP2Connect, OnHTTP2Disconnect, OnHTTP2GoAway, OnHTTP2RSTStreamThe connect, disconnect and stream-reset signals HTTP/2 defines.
SettingsHTTP2Options, SettingsThe local HTTP/2 SETTINGS frame values sent to the peer.
ReliabilityWatchDog, HeartBeat, ThrottleAuto-reconnect, keep-alive and request throttling, shared with the rest of the sgc HTTP stack.
Auth & TLSAuthentication, TLSOptions, OnHTTP2AuthorizationStandard authentication schemes and TLS configuration, plus a hook for custom authorization headers.
DependencysgcCustomIndyALPN negotiates the h2 protocol during the TLS handshake; the standard Indy library cannot do this.

Unary, Server, Client and Bidirectional Streaming

TsgcGRPCClient carries Protocol Buffers payloads over the HTTP/2 client's multiplexed streams, so it covers all four gRPC call shapes.

CapabilityAPINotes
TransportClientA TsgcHTTP2Client instance; the gRPC client rides on it rather than opening its own connection.
Unary RPCCall, CallAsync, CallStringOne request, one response. Call blocks and returns a TsgcGRPCResponse; CallAsync delivers it through OnGRPCResponse.
Server streamingServerStreamingCallOne request, a stream of responses delivered through OnGRPCStreamMessage until OnGRPCStreamEnd.
Client streamingOpenClientStream, SendStreamMessage, CloseClientStream, CloseClientStreamAsyncA stream of requests, one final response when the stream closes.
Bidirectional streamingOpenBidiStream, SendBidiMessage, CloseBidiStreamBoth sides stream independently over the same call.
CancellationCancelCallCancels a call in progress by its stream id.
ResponsesOnGRPCResponse, OnGRPCStreamMessage, OnGRPCStreamEndTsgcGRPCResponse carries StatusCode, Data/DataString, Headers and Trailers.
ErrorsOnGRPCError, OnGRPCExceptiongRPC status-code errors and transport-level exceptions, delivered separately.
MetadataDefaultMetadata, OnGRPCBeforeRequestPer-call and default gRPC metadata headers.
ResilienceRetryPolicy, Interceptors, ServiceConfigRetry behavior, a cross-cutting interceptor chain, and service configuration, without touching individual call sites.
ObservabilityMetricsCollectorCollects call metrics for the client.
DependencysgcCustomIndyInherited from the HTTP/2 client it is built on; ALPN is required the same way.

Pub/Sub, Calendar and Push Notifications

Three code-only classes, authenticated with a Google service account and reached over plain HTTPS. None of them need sgcCustomIndy.

CapabilityAPINotes
AuthenticationGoogleCloudOptions.JWT, OnAuthToken, OnAuthTokenErrorService-account JWT: project id, client email and private key. Shared shape across all three clients.
Pub/Sub: publish & pullPublish, Pull, Acknowledge, SeekTsgcHTTPGoogleCloud_PubSub_Client. Send messages to a topic, pull and acknowledge from a subscription.
Pub/Sub: topicsCreateTopic, DeleteTopic, GetTopic, ListTopicsManage topics directly from code.
Pub/Sub: subscriptionsCreateSubscription, DeleteSubscripton, ListSubscriptions, ModifyAckDeadlineSubscriptionFull subscription lifecycle, including ack-deadline and push-config changes.
Pub/Sub: snapshotsCreateSnapshot, DeleteSnapshot, ListSnapshotsSnapshot a subscription's acknowledgment state for later replay.
Calendar: calendarsNewCalendar, UpdateCalendar, DeleteCalendar, LoadCalendarsTsgcHTTPGoogleCloud_Calendar_Client. Wraps the Google Calendar API v3 calendar list.
Calendar: eventsNewEvent, UpdateEvent, DeleteEvent, LoadEventsCreate, change and remove events on a given calendar.
Calendar: syncLoadCalendarsChanged, LoadEventsChanged, OnGetCalendar, OnGetCalendarEventIncremental synchronization hooks for calendars and events that changed since the last sync.
FCM: pushSendMessageTsgcHTTPGoogleCloud_FCM_Client. One call sends a Firebase Cloud Messaging v1 payload to a project.
TLS and loggingTLSOptions, LogFileShared across all three Google Cloud clients.

APIs, Compilers and Targets

Public standards on the wire, and the same source across every supported compiler.

AreaDetail
HTTP serverHTTP requests and responses, static files, sessions and HTTPS through TsgcHTTPServer.
FastCGI / SCGIThe FastCGI Responder role and SCGI over TCP, with the CGI environment built following RFC 3875, through TsgcHTTPGateway.
HTTP/2RFC 9113, with HPACK header compression and ALPN protocol negotiation.
gRPCProtocol Buffers payloads over HTTP/2 streams, following the gRPC wire protocol.
Google CloudThe Pub/Sub REST API, the Google Calendar API v3, and the Firebase Cloud Messaging HTTP v1 API, all authenticated with a Google service account.
PlatformsWindows Win32, Windows Win64, Linux64, macOS, iOS and Android for all five client classes. The FastCGI / SCGI gateway runs on Windows and Linux.
DependencyThe HTTP/2 and gRPC clients need sgcCustomIndy for ALPN. The Google Cloud clients need only the bundled Core runtime. The FastCGI / SCGI gateway works with the standard Indy that ships with RAD Studio and does not need sgcCustomIndy.
CompilersDelphi and C++ Builder 7 through 13.
EditionsHTTP/2, gRPC and the FastCGI / SCGI gateway also ship inside sgcWebSockets from Enterprise up, and the Google Cloud clients from Standard up. The HTTP server is part of the Core runtime, so every sgcWebSockets edition includes it too.
LicensingStandalone. The sgcWebSockets Core runtime is bundled in and full source code is included.
Best value: All-AccessEvery eSeGeCe product, Premium Support included, from €1,059/year.
See All-Access pricing

Build with sgcHTTP

Download the free trial, publish your first HTTP endpoint, and make your first HTTP/2 or gRPC call from Delphi or C++ Builder.