TsgcWebSocketServer › Olaylar › OnSSLALPNSelect
ALPN etkin bir handshake sırasında tetiklenir, böylece uygulama hangi protokolün müzakere edileceğini seçebilir.
property OnSSLALPNSelect: TsgcWSOnSSLALPNSelect;
// TsgcWSOnSSLALPNSelect = procedure(Sender: TObject; aProtocols: TStringList; var aProtocol: String) of object
—
Bir istemci TLS handshake sırasında Application-Layer Protocol Negotiation duyurduğunda, OnSSLALPNSelect tetiklenir, böylece sunucu hangi protokolün müzakere edileceğine karar verebilir. aProtocols parametresi, istemci tarafından duyurulan adlarla (örneğin "h2", "http/1.1") bir TStringList'tir; aProtocol değerini sunucunun kullanmak istediği protokole atayın. Boş bir dize döndürmek varsayılan davranışı korur, bu durumda TLS katmanı sunucunun desteklediği ilk duyurulan protokolü seçer.
procedure OnSSLALPNSelect(Sender: TObject; aProtocols: TStringList;
var aProtocol: String);
begin
if aProtocols.IndexOf('h2') >= 0 then
aProtocol := 'h2'
else
aProtocol := 'http/1.1';
end;