ucservice 1.2.1 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ucservice",
3
3
  "private": false,
4
- "version": "1.2.1",
4
+ "version": "1.2.4",
5
5
  "description": "统一通信服务",
6
6
  "main": "dist/ucservice.common.js",
7
7
  "style": "ucservice.css",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "keywords": [
29
29
  "janus",
30
- "comted"
30
+ "cometd"
31
31
  ],
32
32
  "author": "shusg",
33
33
  "license": "MIT",
package/src/lib/cometd.js CHANGED
@@ -877,7 +877,9 @@
877
877
  }
878
878
 
879
879
  // Mangle the URL, changing the scheme from 'http' to 'ws'.
880
- var url = _cometd.getURL().replace(/^http/, 'ws');
880
+ // var url = _cometd.getURL().replace(/^http/, 'ws');
881
+ //因证书问题,暂时将https和http都改成ws
882
+ var url = _cometd.getURL().replace(/^https/, 'ws').replace(/^http/, 'ws');
881
883
  this._debug('Transport', this.getType(), 'connecting to URL', url);
882
884
 
883
885
  try {
@@ -2352,9 +2352,12 @@
2352
2352
  }
2353
2353
 
2354
2354
  let janusUrl = me._opts.conf.janusUrl;
2355
- checkIsHttps() && (janusUrl = janusUrl.replace('ws:','wss:'));
2355
+ //没有证书,项目需要不使用wss
2356
+ // checkIsHttps() && (janusUrl = janusUrl.replace('ws:','wss:'));
2356
2357
  me._opts.janus = new Janus({
2357
- server: janusUrl.indexOf("127.0.0.1") == -1 ? janusUrl : janusUrl.split("//")[0] + "//" + (location.hostname)+":"+janusUrl.split(":")[2],
2358
+ // server: janusUrl.indexOf("127.0.0.1") == -1 ? janusUrl : janusUrl.split("//")[0] + "//" + (location.hostname)+":"+janusUrl.split(":")[2],
2359
+ //使用项目必须定义window.janusHttpsHost来适应https
2360
+ server: location.protocol == "https:" ? janusUrl.split("//")[0] + "//" + "szh.rfb.zj.gov.cn/tytx" + "/janus/" : janusUrl,
2358
2361
  success: function(){
2359
2362
  console.log("Janus服务连接成功!");
2360
2363
  me._initSVideo(me._opts.janus);