AppRTC部署运行时错误

时间:2016-07-12 19:45:33

标签: webrtc apprtc

我在Google Cloud Engine上部署了AppRTC。我还使用go命令配置了对撞机。当我加入呼叫时,我在第二个对等体上收到以下错误:

Room server join error: Failed to join the room: Status=500
WebSocket register error: Failed to join the room: Status=500

enter image description here

有人遇到过这个问题吗?

1 个答案:

答案 0 :(得分:0)

它表示您没有转弯服务器,因此请配置您的转弯服务器以及获取TURN服务器信息,您必须配置自己的API

您必须安装TURN服务器并将src / app_engine / constants.py中的TURN_BASE_URL更改为指向您自己的API服务器,该服务器可以发回这样的响应

app.post('/turn', function (req, res) {
  console.log("Turn server needed");
  res.setHeader('Access-Control-Allow-Origin', 'https://apprtc.callstats.io');
  res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
  res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
  res.setHeader('Access-Control-Allow-Credentials', true);
    var turn_server = {
    url: 'turn server url',
    username: 'test',
    credential: '1234',
    realm: 'reTurn'
  };


  var turn_server_tls = {
    url: 'turn server url',
    username: 'test',
    credential: '1234',
    realm: 'reTurn'
  };

  var iceServers = [turn_server,turn_server_tls];

  var pc_config = {'iceTransports': 'all','iceServers': iceServers};
  res.json(pc_config)
});