Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 10|回复: 5
打印 上一主题 下一主题

SimpleWebRTC的研究

[复制链接]

1198

主题

2060

帖子

7058

积分

超级版主

Rank: 8Rank: 8

积分
7058
跳转到指定楼层
楼主
发表于 2016-7-14 19:44:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
回复

使用道具 举报

1198

主题

2060

帖子

7058

积分

超级版主

Rank: 8Rank: 8

积分
7058
沙发
 楼主| 发表于 2016-7-14 19:51:56 | 只看该作者
1,一步一步搭建自己的客户系统
http://www.cnblogs.com/fengwenit/p/4816297.html
这个系列可以参考
回复 支持 反对

使用道具 举报

1198

主题

2060

帖子

7058

积分

超级版主

Rank: 8Rank: 8

积分
7058
板凳
 楼主| 发表于 2016-7-14 20:04:34 | 只看该作者
SimpleWebRTC.js 封装了 WebRTC 技术的 JavaScript ,帮你简化 WebRTC 应用开发。

项目主页:http://simplewebrtc.com/

下载地址:https://github.com/HenrikJoreteg/SimpleWebRTC
回复 支持 反对

使用道具 举报

1198

主题

2060

帖子

7058

积分

超级版主

Rank: 8Rank: 8

积分
7058
地板
 楼主| 发表于 2016-7-15 17:48:16 | 只看该作者
回复 支持 反对

使用道具 举报

1198

主题

2060

帖子

7058

积分

超级版主

Rank: 8Rank: 8

积分
7058
5#
 楼主| 发表于 2016-7-16 00:17:55 | 只看该作者

How to change stun server?

ScrewChineseCommunist commented on Jun 11, 2014

I search "stun" and find google stun server and modified simplewebrtc.bundle.js like this:
peerConnectionConfig: {
// iceServers: [{"url": "stun:stun.l.google.com:19302"}]
iceServers: [{"url": "stun:128.199.x.x:3478"}]
},
and configured rfc5766-turn-server. But the browser console still showed stun:stun.l.google.com:19302
I checked the page source link. I really had changed to my stun server. I'm totally confused.






jsgispert commented on Jun 11, 2014

Hi zhiyin-im! I have exactly the same problem. I'm not a JS expert and have spent the last 24 hours trying to find out what I was doing wrong. Now your message gives me a hint that it might not be my fault after all.
    var stun = {        'url': 'stun:myserver.com:3478'    };    var turn = {        'url': 'turn:myserver.com:3478',        'username': 'mysuser@myrealm',        'credential': 'mypassword'    };    var webrtcConn = new SimpleWebRTC({        ...        peerConnectionConfig: { 'iceServers': [stun, turn] }    });
When I execute and debug, peerConnectionConfig.iceServers contains the default Chrome STUN server "stun:stun.l.google.com:19302" and no TURN servers.






fippo commented on Jun 11, 2014

the default signaling server on signaling.simplewebrtc.com:8888 might override your STUN/TURN config.
There still seems to be a bug though...






fippo commented on Jun 11, 2014

no bug -- just undocumented behaviour. Either run your own https://github.com/andyet/signalmaster
or ignore what the server pushes inhttps://github.com/HenrikJoreteg/SimpleWebRTC/blob/master/simplewebrtc.js#L135






jsgispert commented on Jun 12, 2014

You hit the nail on the head, fippo. After installing and configuring my private signalling server I can see both stun and turn on the console. Thanks a lot!





fippo closed this on Jul 21, 2014




vanney9 commented on Oct 24, 2015

Hi jsgispert,
Have you solved this problem? I try to comment the these lines:
this.webrtc.on('*', function () {
self.emit.apply(self, arguments);
});
and change my stun setting, but i still get the stun:stun.l.google.com:19302 in my console.
Can you help me? thx.






joellusky commented on Jan 24

@vanney9 did you ever solve that issue?






vanney9 commented on Jan 24

@joellusky no, I can not solve it.






AlphaHinex commented on Jan 26

@vanney9 @joellusky
simplewebrtc.js#L135 has changed, you should comment out the following contents:
connection.on('stunservers', function (args) {    // resets/overrides the config    self.webrtc.config.peerConnectionConfig.iceServers = args;    self.emit('stunservers', args);});





Oluwafemikorede commented on Feb 1

@AlphaHinex I am using xirys stun/turn servers, but my app is not working when on separate networks, How do I know which turn server my simplewebrtc is actually using, I mean where do I place my console.log






AlphaHinex commented on Feb 4

@Oluwafemikorede Maybe you can check webrtc.config.peerConnectionConfig in console.






computurus commented on Mar 4

I am also struggling with this problem. Can't force the library to use my STUN server instead of the public one. Is there any way to solve this?





回复 支持 反对

使用道具 举报

1198

主题

2060

帖子

7058

积分

超级版主

Rank: 8Rank: 8

积分
7058
6#
 楼主| 发表于 2016-7-16 00:21:26 | 只看该作者
webRTC check if stun server is beeing used
[url=]up vote[/url]0[url=]down vote[/url]favorite

I decided to create my own STUN server to use it together with the following JS libraryhttps://simplewebrtc.com.
I decided to use this: http://www.stunprotocol.org/
I have followed the instructions and it seems like the server is running. The command sudo lsof -i:3478 (3478 is the default port) outputs this:
stunserve 12856 user    3u  IPv4 232305      0t0  UDP *:3478
I have also modified the JS library to use my server according to this instructions:https://github.com/andyet/SimpleWebRTC (peerConnectionconfig).
peerConnectionConfig:{iceServers:[{urls:"stun:myServerHost:3478"}]}
But when I use tcpdump to capture the traffic on the server nothing is captured like the server is not used. Which server is then used if this one is configured?


shareimprove this question
asked Mar 3 at 13:32


Jacob1,47583481



You can run stuntman with the --verbosity 4 command line parameter to see all server traffic. – selbieMar 6 at 22:21

[url=]add a comment[/url]

1 Answeractiveoldestvotes



[url=]up vote[/url]1[url=]down vote[/url]

Actually the configuration is like this:
{ iceServers: [     {        "url": "stun:your.stun.server"        , "username": "user"        , "credential": "password"    }]}
Credentials are optional. And you can usehttps://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ to test your stun server.

shareimprove this answer
answered Mar 3 at 13:55


Adrian Ber4,72852246


Testing the server I don't get it, no mather what I type as a server, some candidates are always returned – Jacob Mar 3 at 13:59
Compare with and without your server, the number of candidates or select 'relay' instead of 'all'. – Adrian BerMar 3 at 14:07
Actually, url got renamed to urls. – jib Mar 3 at 21:34
I guess I am setting the configuration the wrong way. What would be the correct way? This is not workig: webrtc.config.peerConnectionConfig = ....... – Jacob Mar 4 at 9:29





回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Comsenz Inc.

GMT+8, 2025-12-15 02:07 , Processed in 0.021788 second(s), 7 queries , Apc On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表