TURN 协议

sgcWebSockets 中的 TURN(Traversal Using Relays around NAT)支持。在无法建立直接 P2P 连接时中继流量。

功能概览

  • 在直接 P2P 失败时中继媒体和数据
  • 符合 RFC 5766 标准的实现
  • 分配和权限管理
  • 通道绑定以实现高效中继
  • 与 STUN 和 ICE 协同实现完整 NAT 穿透

Delphi 示例

uses
  sgcTURN_Client;

var
  TURN: TsgcTURNClient;
begin
  TURN := TsgcTURNClient.Create(nil);
  TURN.Host := 'turn.example.com';
  TURN.Port := 3478;
  TURN.Credentials.Username := 'user';
  TURN.Credentials.Password := 'pass';
  TURN.Allocate;
end;

准备好使用 TURN 了吗?

下载免费试用版,几分钟内即可开始构建。