Il TURN Server supporta l'autenticazione a lungo termine, l'allocazione, i permessi, il Channel Data e altro ancora.
TsgcTURNServer è il server che implementa il protocollo TURN e consente di elaborare le richieste dai client TURN. Il componente eredita da TsgcSTUNServer, quindi tutti i metodi e le proprietà sono disponibili su TsgcTURNServer.
Il TURN Server supporta l'autenticazione a lungo termine, l'allocazione, i permessi, il Channel Data e altro ancora.
Di solito i server TURN sono in ascolto sulla porta UDP 3478 e richiedono credenziali Long-Term; per configurare un server TURN è quindi necessario impostare la porta di ascolto (per impostazione predefinita 3478) e avviare il server.
Configurare il server
Impostare la proprietà Active = True per avviare il server TURN.
oTURN := TsgcTURNServer.Create(nil);
oTURN.Port := 3478;
oTURN.TURNOptions.Authentication.Enabled := True;
oTURN.TURNOptions.Authentication.LongTermCredentials.Enabled := True;
oTURN.TURNOptions.Authentication.LongTermCredentials.Realm := 'esegece.com';
oTURN.Active := True;
procedure OnSTUNRequestAuthorization(Sender: TObject; const aRequest: TsgcSTUN_Message;
const aUsername, aRealm: string; var Password: string);
begin
if (aUsername = 'user') and (aRealm = 'esegece.com') then
Password := 'password';
end;
Configurazioni
Allocazioni