2016-11-24 4 views
0

は、私は、これらの指示に従ってrhel7にresiprocateリターン・サーバをインストールして、正確に、数2次 https://www.webrtc-experiment.com/docs/TURN-server-installation-guide.htmlreTurn Server(resiprocate)が応答しない、設定エラー?

Iは次のように設定した:

TurnAddress = 172.31.40.178 
AltStunAddress = 172.31.40.179 
TurnPort = 3478 
AltStunPort = 5349 

第一及び第二IPの両方に構成されているとpingすることができます。これはifconfigの出力です。

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9001 
     inet 172.31.40.178 netmask 255.255.240.0 broadcast 172.31.47.255 
     inet6 fe80::45e:20ff:fe6b:6869 prefixlen 64 scopeid 0x20<link> 
     ether 06:5e:20:6b:68:69 txqueuelen 1000 (Ethernet) 
     RX packets 5100789 bytes 890198603 (848.9 MiB) 
     RX errors 0 dropped 0 overruns 0 frame 0 
     TX packets 4742159 bytes 3984379336 (3.7 GiB) 
     TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 

eth0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9001 
     inet 172.31.40.179 netmask 255.255.240.0 broadcast 172.31.47.255 
     ether 06:5e:20:6b:68:69 txqueuelen 1000 (Ethernet) 

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 
     inet 127.0.0.1 netmask 255.0.0.0 
     inet6 ::1 prefixlen 128 scopeid 0x10<host> 
     loop txqueuelen 0 (Local Loopback) 
     RX packets 460812 bytes 163626411 (156.0 MiB) 
     RX errors 0 dropped 0 overruns 0 frame 0 
     TX packets 460812 bytes 163626411 (156.0 MiB) 
     TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 

このポートは開いています。

リターンのためのnetstatの出力は、次のとおりです。私はハッシュされたパスワードを設定し、自分のドメイン名などを使用している

tcp  0  0 172.31.40.178:3478  0.0.0.0:* 
LISTEN  17177/reTurnServer 
tcp  0  0 172.31.40.178:5349  0.0.0.0:* 
LISTEN  17177/reTurnServer 
tcp6  0  0 :::3478     :::* 
LISTEN  17177/reTurnServer 
tcp6  0  0 :::5349     :::* 
LISTEN  17177/reTurnServer 
udp  0  0 172.31.40.179:3478  0.0.0.0:* 
     17177/reTurnServer 
udp  0  0 172.31.40.178:3478  0.0.0.0:* 
     17177/reTurnServer 
udp  0  0 172.31.40.179:3479  0.0.0.0:* 
     17177/reTurnServer 
udp  0  0 172.31.40.178:3479  0.0.0.0:* 
     17177/reTurnServer 
udp6  0  0 :::3478     :::* 
     17177/reTurnServer 

。 test.example.comをレルムとして使用します。

ターンサーバーに接続しようとすると失敗します。私は、正しいユーザ名とパスワードを使用して、接続をテストするには、次のコードを使用しています、そしてそれは常に「いいえ」出力します

function checkTURNServer(turnConfig, timeout){ 

    return new Promise(function(resolve, reject){ 

    setTimeout(function(){ 
     if(promiseResolved) return; 
     resolve(false); 
     promiseResolved = true; 
    }, timeout || 5000); 

    var promiseResolved = false 
     , myPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection //compatibility for firefox and chrome 
     , pc = new myPeerConnection({iceServers:[turnConfig]}) 
     , noop = function(){}; 
    pc.createDataChannel(""); //create a bogus data channel 
    pc.createOffer(function(sdp){ 
     if(sdp.sdp.indexOf('typ relay') > -1){ // sometimes sdp contains the ice candidates... 
     promiseResolved = true; 
     resolve(true); 
     } 
     pc.setLocalDescription(sdp, noop, noop); 
    }, noop); // create offer and set local description 
    pc.onicecandidate = function(ice){ //listen for candidate events 
     if(promiseResolved || !ice || !ice.candidate || !ice.candidate.candidate || !(ice.candidate.candidate.indexOf('typ relay')>-1)) return; 
     promiseResolved = true; 
     resolve(true); 
    }; 
    }); 
} 

checkTURNServer({ 
      'url': 'turn:test.*****.com:3478', 
      'credential': 'password', 
      'username': 'username' 
}).then(function(bool){ 
    console.log('is TURN server active? ', bool? 'yes':'no'); 
}).catch(console.error.bind(console)); 

私は任意の助けのために感謝を超えるだろう、私は私のビー玉を失うことを始めています。

多くのありがとうございます。

答えて

1

172.31.40.178はプライベートIPアドレス範囲にあります。つまり、NATの背後からSTUNとTURNを実行しています。ポート3478,3479、および5349(UDPとTCP)をサーバーに適切に転送できるようにしておけば、それは間違いありません。

あなたの質問には、サーバーがAmazon EC2上で実行されていることを示唆するのに十分なヒントがあります。その場合、ポート転送はEC2インスタンスのsecurity groupによって設定されます。このインスタンスに関連付けられたセキュリティグループに対して、IP範囲0.0.0.0/0のポート3478,3479、および5349を許可するUDPとTCPの両方の受信ルールのセットを有効にします。また、VPCセキュリティグループとnetweork acl設定を確認しますが、これらの設定は通常、デフォルトでは有効になっています。

アマゾンにいない場合は、ホスティングプロバイダまたはローカルNATを有効にして、これらのポートをサーバーのIPにポート転送する必要があります。

また、IPTableルールが有効になっている場合、トラフィックをブロックしていないことを確認してください。

+0

ありがとう非常に多くの今これが動作します。それはUDPではありませんでした。 –

関連する問題