TURN サーバーはロングターム認証、Allocation、パーミッション、チャンネルデータなどをサポートします。
TsgcTURNServerはTURNプロトコルを実装し、TURNクライアントからのリクエストを処理できるサーバーです。このコンポーネントはTsgcSTUNServerから継承しているため、すべてのメソッドとプロパティがTsgcTURNServerで利用できます。
TURN サーバーはロングターム認証、Allocation、パーミッション、チャンネルデータなどをサポートします。
通常、TURN サーバーは UDP ポート 3478 で動作し、長期資格情報を必要とします。TURN サーバーを設定するには、リッスン ポート(デフォルト 3478)を設定してサーバーを起動します。
サーバーの設定
TURN サーバーを起動するには、プロパティ Active = True を設定します。
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;
設定
アロケーション