Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change stun server? #134

Closed
ScrewChineseCommunist opened this issue Jun 10, 2014 · 16 comments
Closed

How to change stun server? #134

ScrewChineseCommunist opened this issue Jun 10, 2014 · 16 comments

Comments

@ScrewChineseCommunist
Copy link

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
Copy link

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
Copy link
Contributor

fippo commented 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
Copy link
Contributor

fippo commented Jun 11, 2014

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

@jsgispert
Copy link

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 fippo closed this as completed Jul 20, 2014
@vanney9
Copy link

vanney9 commented 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
Copy link

@vanney9 did you ever solve that issue?

@vanney9
Copy link

vanney9 commented Jan 24, 2016

@joellusky no, I can not solve it.

@AlphaHinex
Copy link

@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
Copy link

@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
Copy link

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

@computurus
Copy link

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?

@billyshena
Copy link

billyshena commented Nov 10, 2016

Did someone manage to make it work with SimpleWebRTC and xirsys ?
I manually installed a Signalmaster server (https://github.com/andyet/signalmaster) and here is how my config file looks like:

{
  "isDev": true,
  "server": {
    "port": 8886,
    "/* secure */": "/* whether this connects via https */",
    "secure": false,
    "key": null,
    "cert": null,
    "password": null
  },
  "rooms": {
    "/* maxClients */": "/* maximum number of clients per room. 0 = no limit */",
    "maxClients": 0
  },
  "stunservers": [
    {
      "url": "stun:turn02.uswest.xirsys.com"
    }
  ],
  "turnservers": [
    {
      "urls": ["turn:your_turn_server"],
      "secret": "turnserversharedsecret",
      "expiry": 86400
    }
  ]
}

But when I check my xirsys dashboard, I always have "0 STUN connections".
I also tried to comment connection.on('stunservers', function (args) { // resets/overrides the config self.webrtc.config.peerConnectionConfig.iceServers = args; self.emit('stunservers', args); }); but the dashboard still shows "0 STUN"

Any ideas ?

Best,

@xdumaine
Copy link
Contributor

@billyshena I can't speak to how xirsys will show you connections, but you should be able to use chrome://webrtc-internals to determine if you're able to gather candidates. Also note that because this is a mesh lib, you won't create peer connections with candidates until you have at least two people.

@ttheekshanaw
Copy link

Comment this line :D

r.webrtc.config.peerConnectionConfig.iceServers = e, r.emit("stunservers", e)

@maxping76
Copy link

maxping76 commented Aug 9, 2017

@billyshena Yes, I could do it with SimpleWebRTC + Signaling + xirsys.
Tell me if you are still interested

@deepakjsr7979
Copy link

still interested help me out SimpleWebRTC + Signaling + xirsys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests