0

在所有示例中,我看到 Twilio VIdeo 仅在 node.js 上用作 Web 服务器。

是否可以在 IIS 以及用 C# 编写的服务器和客户端部分上运行它?

4

1 回答 1

1

Twilio 布道者在这里。

页面包含用于在 C# 中生成访问令牌的代码:

using System;
using Twilio.Jwt.AccessToken;

class Example
{
  static void Main(string[] args)
  {
    // Substitute your Twilio AccountSid and ApiKey details
    var AccountSid = "accountSid";
    var ApiKeySid = "apiKeySid;
    var ApiKeySecret = "apiKeySecret";

    var identity = "example-user";

    // Create a video grant for the token
    var grant = new VideoGrant();
    grant.Room = "cool room";
    var grants = new HashSet { grant };

    // Create an Access Token generator
    var token = new Token(accountSid, apiKey, apiSecret, identity: identity, grants: grants);

    // Serialize the token as a JWT
    Console.WriteLine(token.ToJwt());
  }
}

还有一个Github存储库,其中包含 C# 中的完整令牌服务器示例。

希望有帮助。

于 2018-05-11T17:16:38.523 回答