Просмотр исходного кода

ref: Use STUN/TURN for the P2P connection.

dev1
George Politis 8 лет назад
Родитель
Сommit
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
                     }
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
             }, err => {
368
             }, err => {
361
                 logger.warn('getting turn credentials failed', err);
369
                 logger.warn('getting turn credentials failed', err);
362
                 logger.warn('is mod_turncredentials or similar installed?');
370
                 logger.warn('is mod_turncredentials or similar installed?');

+ 1
- 1
modules/xmpp/xmpp.js Просмотреть файл

133
             now);
133
             now);
134
         if (status === Strophe.Status.CONNECTED
134
         if (status === Strophe.Status.CONNECTED
135
             || status === Strophe.Status.ATTACHED) {
135
             || status === Strophe.Status.ATTACHED) {
136
-            if (this.options.useStunTurn) {
136
+            if (this.options.useStunTurn || this.options.p2p.useStunTurn) {
137
                 this.connection.jingle.getStunAndTurnCredentials();
137
                 this.connection.jingle.getStunAndTurnCredentials();
138
             }
138
             }
139
 
139
 

Загрузка…
Отмена
Сохранить