lef*_*loh 8 oauth stun webrtc rfc5766turnserver turn
我想和oAuth一起使用coturn.如果我理解正确,我需要做两件事:
ACCESS-TOKEN和USERNAMESTUN属性第一点很清楚,但我如何更改我的WebRTC客户端以实现第二点?
没有oAuth,我会RTCPeerConnection像这样初始化我:
var configuration = {
'iceServers': [{
'url': 'turn:turn.example.org',
'username': 'user',
'credential': 'password'
}]
};
var pc = new RTCPeerConnection(configuration)
Run Code Online (Sandbox Code Playgroud)
的的WebRTC 1.0草案定义了一个RTCIceCredentialType枚举所以,我觉得我需要改变这样的我的配置:
var configuration = {
'iceServers': [{
'url': 'turn:turn.example.org',
'username': 'kid',
'credential': 'oAuthToken',
'credentialType': 'token'
}]
};
Run Code Online (Sandbox Code Playgroud)
使用Wireshark我看不到ACESS-TOKEN属性.任何想法或有谁知道一个工作的例子?
自从提出最初的问题以来,事情似乎发生了一些变化。webrtc -pc#1033 pull-request 改变了规范并引入了以下iceServers配置语法:
var configuration = {
'iceServers': [{
"urls": "turns:turn.example.net",
"username": "username",
"credential": {
"macKey": "...",
"accessToken": "..."
},
"credentialType": "oauth"
}],
...
}
Run Code Online (Sandbox Code Playgroud)
有关更多配置示例,请参阅RTCIceServer文档页面。
| 归档时间: |
|
| 查看次数: |
2266 次 |
| 最近记录: |