TsgcWSAPIServer_WebPushProperties › WebPush

WebPush Property

Options container for Web Push configuration: VAPID keys, client TLS/log settings and the built-in HTTP endpoints served by the component.

Syntax

property WebPush: TsgcWSWebPush_Options read FWebPush write SetWebPush;

Default Value

Remarks

Exposes three sub-sections required to deliver Web Push notifications: VAPID (PublicKey, PrivateKey and Subject/mailto used to sign each POST to the push service in DER and PEM PKCS8 formats); ClientOptions (TLS, logging and HTTP client options used by the internal sender — Web Push requires OpenSSL 3.0.0); and Endpoints (the URLs served by the attached TsgcWebSocketHTTPServer: Home, WebPush javascript, ServiceWorker, VAPIDPublicKey, Subscription and Unsubscription). DefaultTTL, DefaultUrgency and encryption parameters are carried inside ClientOptions and the per-call message so the server POSTs an encrypted payload (aes128gcm, RFC 8030) to each browser's subscription endpoint.

Example

sgcWSAPIServer_WebPush1.WebPush.VAPID.DER.PublicKey  := 'BASE64URL_PUBLIC_KEY';
sgcWSAPIServer_WebPush1.WebPush.VAPID.DER.PrivateKey := 'BASE64URL_PRIVATE_KEY';
sgcWSAPIServer_WebPush1.WebPush.VAPID.Details.Subject := 'mailto:info@esegece.com';
sgcWSAPIServer_WebPush1.WebPush.ClientOptions.Log    := True;
sgcWSAPIServer_WebPush1.WebPush.Endpoints.Home.Endpoint := '/sgcWebPush.html';

Back to Properties