How to self-host to not rely on WebRTC STUN server stun.l.google.com:19302?

后端 未结 4 1999
时光说笑
时光说笑 2020-12-07 10:20

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 ser

4条回答
  •  醉话见心
    2020-12-07 10:30

    This is the new way to config STUN and TURN in RTCPeerConnection initialization. Below is the working mode from 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

提交回复
热议问题