TsgcHTTP3Server › Properties › Active
Starts or stops the HTTP/3 server listener.
property Active: Boolean;
Boolean
False
Setting Active to True binds the QUIC listener to the configured Port (UDP) and starts accepting HTTP/3 connections; setting it to False closes the listener and stops the server. Each transition raises OnStartup and OnShutdown respectively.
Start and Stop are the equivalent methods, so Active := True and Start do the same work. Use whichever fits the code; the property is the one that is streamed from the form file, so a component dropped on a form with Active set to True in the Object Inspector starts as soon as the form is loaded.
Everything the listener needs must be configured first, since these values are read when the listener is created: Port, the certificate and private key in QUICOptions.SSLOptions, and any H3Settings you want advertised. QUIC mandates TLS 1.3, so activation fails with an exception when the certificate or the key is missing or the two do not match.
This property is inherited from TsgcQUICServer.
oServer := TsgcHTTP3Server.Create(nil);
oServer.Port := 443;
oServer.QUICOptions.SSLOptions.CertFile := 'cert.pem';
oServer.QUICOptions.SSLOptions.KeyFile := 'key.pem';
oServer.Active := True;