diff --git a/node_modules/iphunter/dist/main.js b/node_modules/iphunter/dist/main.js index fd0ef89..c98d393 100644 --- a/node_modules/iphunter/dist/main.js +++ b/node_modules/iphunter/dist/main.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.iphunter=t():e.iphunter=t()}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;if(!(e&&e.length&&t))throw new Error("ips and callback are required.");new o(e,t,n)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();t.default=i;var o=function(){function e(t,i,r){n(this,e),this.ip="",this.ipcallback=i,this.timeoutId=null,this.reqsCache=[];for(var o=0;o<t.length;o++)this.reqsCache.push(this.send(t[o],r-10));this.timeoutId=setTimeout(this.notify.bind(this),r)}return r(e,[{key:"clearAll",value:function(){this.reqsCache&&this.reqsCache.length&&this.reqsCache.forEach(function(e){e.abort()}),clearTimeout(this.timeoutId),this.ip="",this.ipcallback=null,this.timeoutId=null,this.reqsCache=[]}},{key:"clearReq",value:function(e){this.reqsCache.splice(this.reqsCache.indexOf(e),1)}},{key:"notify",value:function(){this.ipcallback(this.ip),this.clearAll()}},{key:"send",value:function(e,t){var n=this,i=new XMLHttpRequest;return i.open("HEAD","//"+e+"/?_="+Date.now()),i.timeout=t,i.onload=function(){n.ip=e,n.clearReq(i),i.onload=null,n.notify()},i.ontimeout=function(){n.clearReq(i),i.ontimeout=null},i.onerror=function(){n.clearReq(i),i.onerror=null},i.onabort=function(){n.clearReq(i),i.onabort=null},i.send(),i}}]),e}();(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(o,"IpHunter","/Users/AlexWang/ws/iphunter/src/main.js"),__REACT_HOT_LOADER__.register(i,"check","/Users/AlexWang/ws/iphunter/src/main.js"))})()}])}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.iphunter=t():e.iphunter=t()}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;if(!(e&&e.length&&t))throw new Error("ips and callback are required.");new r(e,t,n)}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();t.default=i;var r=function(){function e(t,i,o){n(this,e),this.version="v2.0.1.20170819",this.ip="",this.ipcallback=i,this.timeoutId=null,this.reqsCache=[];for(var r=0;r<t.length;r++)this.reqsCache.push(this.send(t[r],o-10));this.timeoutId=setTimeout(this.notify.bind(this),o)}return o(e,[{key:"clearAll",value:function(){this.reqsCache&&this.reqsCache.length&&this.reqsCache.forEach(function(e){e.abort()}),clearTimeout(this.timeoutId),this.ip="",this.ipcallback=null,this.timeoutId=null,this.reqsCache=[]}},{key:"clearReq",value:function(e){this.reqsCache.splice(this.reqsCache.indexOf(e),1)}},{key:"notify",value:function(){this.ipcallback&&this.ipcallback(this.ip),this.clearAll()}},{key:"send",value:function(e,t){var n=this,i=new XMLHttpRequest;return i.open("HEAD","//"+e+"/?_="+Date.now()),i.timeout=t,i.onload=function(){n.ip=e,n.clearReq(i),i.onload=null,n.notify()},i.ontimeout=function(){n.clearReq(i),i.ontimeout=null},i.onerror=function(){n.clearReq(i),i.onerror=null},i.onabort=function(){n.clearReq(i),i.onabort=null},i.send(),i}}]),e}();(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(r,"IpHunter","D:/work/McuClient/node_modules/iphunter/src/main.js"),__REACT_HOT_LOADER__.register(i,"check","D:/work/McuClient/node_modules/iphunter/src/main.js"))})()}])}); \ No newline at end of file diff --git a/node_modules/iphunter/dist/test.js b/node_modules/iphunter/dist/test.js index 4ebe57f..6ad3c61 100644 --- a/node_modules/iphunter/dist/test.js +++ b/node_modules/iphunter/dist/test.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.iphunter=t():e.iphunter=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(2)},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;if(!(e&&e.length&&t))throw new Error("ips and callback are required.");new r(e,t,n)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}();t.default=o;var r=function(){function e(t,o,i){n(this,e),this.ip="",this.ipcallback=o,this.timeoutId=null,this.reqsCache=[];for(var r=0;r<t.length;r++)this.reqsCache.push(this.send(t[r],i-10));this.timeoutId=setTimeout(this.notify.bind(this),i)}return i(e,[{key:"clearAll",value:function(){this.reqsCache&&this.reqsCache.length&&this.reqsCache.forEach(function(e){e.abort()}),clearTimeout(this.timeoutId),this.ip="",this.ipcallback=null,this.timeoutId=null,this.reqsCache=[]}},{key:"clearReq",value:function(e){this.reqsCache.splice(this.reqsCache.indexOf(e),1)}},{key:"notify",value:function(){this.ipcallback(this.ip),this.clearAll()}},{key:"send",value:function(e,t){var n=this,o=new XMLHttpRequest;return o.open("HEAD","//"+e+"/?_="+Date.now()),o.timeout=t,o.onload=function(){n.ip=e,n.clearReq(o),o.onload=null,n.notify()},o.ontimeout=function(){n.clearReq(o),o.ontimeout=null},o.onerror=function(){n.clearReq(o),o.onerror=null},o.onabort=function(){n.clearReq(o),o.onabort=null},o.send(),o}}]),e}();(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(r,"IpHunter","/Users/AlexWang/ws/iphunter/src/main.js"),__REACT_HOT_LOADER__.register(o,"check","/Users/AlexWang/ws/iphunter/src/main.js"))})()},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var i=n(1),r=o(i);(0,r.default)(["192.168.99.199","baidu.com","aliyun.com","qq.com","192.168.99.100","127.0.0.0:8080","192.168.1.48:8080","localhost:8080"],function(e){console.log("done -> ",e)});(function(){"undefined"==typeof __REACT_HOT_LOADER__})()}])}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.iphunter=t():e.iphunter=t()}(this,function(){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){!function(){throw new Error('Cannot find module "./test.js"')}()}])}); \ No newline at end of file diff --git a/node_modules/iphunter/package.json b/node_modules/iphunter/package.json index 7e81a36..66afb84 100644 --- a/node_modules/iphunter/package.json +++ b/node_modules/iphunter/package.json @@ -73,8 +73,8 @@ "wbp": { "build": "dist/", "entries": { - "main": "./src/main.js", - "test": "./test/test.js" + "main": "./main.js", + "test": "./test.js" }, "project": "umd", "source": "src/" diff --git a/node_modules/iphunter/src/main.js b/node_modules/iphunter/src/main.js index 0399baf..80bb5a5 100644 --- a/node_modules/iphunter/src/main.js +++ b/node_modules/iphunter/src/main.js @@ -1,5 +1,6 @@ class IpHunter { constructor(ips, callback, timeout) { + this.version="v2.0.1.20170819" this.ip = ''; this.ipcallback = callback; this.timeoutId = null; @@ -29,7 +30,9 @@ class IpHunter { } notify() { - this.ipcallback(this.ip); + if(this.ipcallback){ + this.ipcallback(this.ip); + } this.clearAll(); } diff --git a/src/EngineEntrance.js b/src/EngineEntrance.js index 2c42d03..b588abc 100644 --- a/src/EngineEntrance.js +++ b/src/EngineEntrance.js @@ -58,7 +58,7 @@ export default class MessageEntrance extends Emiter { constructor() { super(); //sdk 信息 - GlobalConfig.sdkVersion = "v1.76.2.20170818"; + GlobalConfig.sdkVersion = "v1.77.4.20170819"; loger.warn("sdkVersion:" + GlobalConfig.sdkVersion); //设置 diff --git a/src/IpManager.js b/src/IpManager.js index bd7a76a..7fb0d3f 100644 --- a/src/IpManager.js +++ b/src/IpManager.js @@ -16,8 +16,8 @@ const loger = Loger.getLoger('IpManager'); const TIME_OUT = 2000;//选点超时 const MS_DEFAULT_PORT = "1935";//默认流媒体端口 const MCU_DEFAULT_PORT = "";//默认的mcu端口 //7777 -const SPEED_TEST_PORT = '5555';//测速端口(MCU/MS) - +const SPEED_TEST_PORT = '5555';//测速端口(MS) +const MCU_SPEED_TEST_PORT = '5556';//测速端口(MCU) class IpManager extends Emiter { constructor() { super(); @@ -135,7 +135,7 @@ class IpManager extends Emiter { if (msItem && msItem.ip) { //测速的时候,ip地址要拼接成带端口的完整地址,测速的端口是固定的 //newList.add((msItem.ip + ':' + SPEED_TEST_PORT)); - newList[msItem.ip + ':' + SPEED_TEST_PORT]=msItem.ip + ':' + SPEED_TEST_PORT; + newList[msItem.ip + ':' + MCU_SPEED_TEST_PORT]=msItem.ip + ':' + MCU_SPEED_TEST_PORT; } } //过滤完重复ip @@ -161,7 +161,7 @@ class IpManager extends Emiter { } } else { loger.log('MCU选点->done -> ', fatest_ip_response); - let fastestIp = fatest_ip_response.replace((':' + SPEED_TEST_PORT), '') || "" + let fastestIp = fatest_ip_response.replace((':' + MCU_SPEED_TEST_PORT), '') || "" callbackData.ip = fastestIp; callbackData.port = ''; diff --git a/src/apes/ShareApe.js b/src/apes/ShareApe.js index 9a1d8c3..a10bf00 100644 --- a/src/apes/ShareApe.js +++ b/src/apes/ShareApe.js @@ -5,7 +5,7 @@ import Loger from 'Loger'; import MessageTypes from 'MessageTypes'; import GlobalConfig from 'GlobalConfig'; import EngineUtils from 'EngineUtils'; -import ShareScreen from 'ss' +import ShareScreen from 'screenShare' import Emiter from 'Emiter'; import ApeConsts from './ApeConsts'; let loger = Loger.getLoger('ShareApe'); @@ -21,14 +21,13 @@ class ShareApe extends Emiter { //this.shareScreen=new ShareScreen(); this.shareScreen=ShareScreen; this.defaultPort='605';//以前用的是8089 - this.defaultIp='127.0.0.1'; + this.defaultIp='localhost.xuedianyun.com';//127.0.0.1 this.ip=this.defaultIp; this.port=this.defaultPort; - + this.fullIpPort=''; this.init(); } init(){ - // 版本信息 this.shareScreen.on(ShareScreen.VERSION_INFO_CHANGE, (d) => { console.log('VERSION_INFO_CHANGE->', d); @@ -115,8 +114,19 @@ class ShareApe extends Emiter { startConnectSocket(){ clearTimeout(this.reConnectTimer); if(!this.isConnect){ - console.log('开始连接本地流媒体服务->'); - this.shareScreen.start(this.ip, this.port); + + //this.shareScreen.start(this.ip, this.port); + if(this.port){ + this.fullIpPort = GlobalConfig.websocketProtocol + this.ip + ':' + this.port; + }else { + this.fullIpPort = GlobalConfig.websocketProtocol + this.ip; + } + if(GlobalConfig.isHttps==true){ + //https的时候替换所有80端口 + this.fullIpPort= GlobalConfig.replacePort(this.fullIpPort,":80",""); + } + loger.log('开始连接本地流媒体服务->',this.fullIpPort); + this.shareScreen.startConnect(this.fullIpPort); } }