瀏覽代碼

ref: Use STUN/TURN for the P2P connection.

dev1
George Politis 8 年之前
父節點
當前提交
4934fbe859
共有 2 個檔案被更改,包括 10 行新增2 行删除
  1. 9
    1
      modules/xmpp/strophe.jingle.js
  2. 1
    1
      modules/xmpp/xmpp.js

+ 9
- 1
modules/xmpp/strophe.jingle.js 查看文件

@@ -356,7 +356,15 @@ class JingleConnectionPlugin extends ConnectionPlugin {
356 356
                     }
357 357
                     }
358 358
                 });
359
-                this.jvbIceConfig.iceServers = iceservers;
359
+
360
+                if (this.xmpp.options.useStunTurn) {
361
+                    this.jvbIceConfig.iceServers = iceservers;
362
+                }
363
+
364
+                if (this.xmpp.options.p2p.useStunTurn) {
365
+                    this.p2pIceConfig.iceServers = iceservers;
366
+                }
367
+
360 368
             }, err => {
361 369
                 logger.warn('getting turn credentials failed', err);
362 370
                 logger.warn('is mod_turncredentials or similar installed?');

+ 1
- 1
modules/xmpp/xmpp.js 查看文件

@@ -133,7 +133,7 @@ export default class XMPP extends Listenable {
133 133
             now);
134 134
         if (status === Strophe.Status.CONNECTED
135 135
             || status === Strophe.Status.ATTACHED) {
136
-            if (this.options.useStunTurn) {
136
+            if (this.options.useStunTurn || this.options.p2p.useStunTurn) {
137 137
                 this.connection.jingle.getStunAndTurnCredentials();
138 138
             }
139 139
 

Loading…
取消
儲存