node.js WEBRTC STUN stun.l.google.com:19302

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20068944/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 16:18:33  来源:igfitidea点击:

WEBRTC STUN stun.l.google.com:19302

node.jswebrtcstun

提问by Vicky

I have just downloaded a video chat project. It uses a STUN server and specifies the URL stun:23.21.150.121. How can I use my own server instead of the STUN server? What do I have to enter instead of this URL?

我刚刚下载了一个视频聊天项目。它使用 STUN 服务器并指定 URL stun:23.21.150.121。如何使用我自己的服务器而不是 STUN 服务器?我必须输入什么而不是这个 URL?

回答by Vlad Tsepelev

Actually there is no need to setup your own STUN or TURN servers, because there are a lot of public/semipublic servers. STUN from Google not always works very well.

实际上没有必要设置你自己的 STUN 或 TURN 服务器,因为有很多公共/半公共服务器。来自 Google 的 STUN 并不总是很好用。

This is my latest verified list (don't forget stun:/turn: scheme in URL):

这是我最新验证的列表(不要忘记 stun:/turn: 方案在 URL):

{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},
{url:'stun:stun3.l.google.com:19302'},
{url:'stun:stun4.l.google.com:19302'},
{url:'stun:stunserver.org'},
{url:'stun:stun.softjoys.com'},
{url:'stun:stun.voiparound.com'},
{url:'stun:stun.voipbuster.com'},
{url:'stun:stun.voipstunt.com'},
{url:'stun:stun.voxgratia.org'},
{url:'stun:stun.xten.com'},
{
    url: 'turn:numb.viagenie.ca',
    credential: 'muazkh',
    username: '[email protected]'
},
{
    url: 'turn:192.158.29.39:3478?transport=udp',
    credential: 'JZEOEt2V3Qb0y27GRntt2u2PAYA=',
    username: '28224511:1379330808'
},
{
    url: 'turn:192.158.29.39:3478?transport=tcp',
    credential: 'JZEOEt2V3Qb0y27GRntt2u2PAYA=',
    username: '28224511:1379330808'
}

https://gist.github.com/yetithefoot/7592580

https://gist.github.com/yetithefoot/7592580

In case if you need your own STUN server, you can use this onewritten for Node.js, or find some here.

如果你需要自己的 STUN 服务器,你可以使用这个为 Node.js 编写的服务器,或者在这里找到一些。

Also you can check thisand thispages for better understanding.

您也可以查看页面和页面以更好地理解。

回答by Devaroop

This is the new way to config STUN and TURN in RTCPeerConnection initialization. Below is the working mode from apprtc.appspot.com

这是在 RTCPeerConnection 初始化中配置 STUN 和 TURN 的新方法。下面是来自 apprtc.appspot.com 的工作模式

var peerConnectionConfig = {
  iceServers:[
    {urls: ["turn:173.194.72.127:19305?transport=udp",
       "turn:[2404:6800:4008:C01::7F]:19305?transport=udp",
       "turn:173.194.72.127:443?transport=tcp",
       "turn:[2404:6800:4008:C01::7F]:443?transport=tcp"
       ],
     username:"CKjCuLwFEgahxNRjuTAYzc/s6OMT",
     credential:"u1SQDR/SQsPQIxXNWQT7czc/G4c="
    },
    {urls:["stun:stun.l.google.com:19302"]}
  ]};

More info here

更多信息在这里

回答by olegarch

EmerCoin has large list of public STUN servers: http://enumer.org/public-stun.txtYou can use any of them.

EmerCoin 拥有大量公共 STUN 服务器:http://enumer.org/public-stun.txt 您可以使用其中任何一个。

回答by Munim

There are a few options to set up your own stun server. There is the rfc5766-turn-server. Once you set it up on your server, you can use that server's IP address and port you have set it to listen to. You will need some basic linux sysadmin knowledge for this.

有几个选项可以设置您自己的 stun 服务器。有rfc5766-turn-server。在您的服务器上设置好之后,您就可以使用该服务器的 IP 地址和您设置为侦听的端口。为此,您将需要一些基本的 linux 系统管理员知识。