Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
李勇
/
McuClient
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
李勇
2017-08-14 18:52:17 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7344db648e2a6356ca256c263b5da2e3bd7e0aeb
7344db64
1 parent
c0c850f2
1.https和http情况下分别处理MCU SAAS DOC的80端口处理;
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
44 行增加
和
5 行删除
src/EngineEntrance.js
src/EverSocket.js
src/GlobalConfig.js
src/IpManager.js
src/EngineEntrance.js
查看文件 @
7344db6
...
...
@@ -58,7 +58,7 @@ export default class MessageEntrance extends Emiter {
constructor
()
{
super
();
//sdk 信息
GlobalConfig
.
sdkVersion
=
"v1.7
1.0.20170813
"
;
GlobalConfig
.
sdkVersion
=
"v1.7
3.1.20170814
"
;
loger
.
warn
(
"sdkVersion:"
+
GlobalConfig
.
sdkVersion
);
//设置
...
...
@@ -504,7 +504,7 @@ export default class MessageEntrance extends Emiter {
GlobalConfig
.
portal
=
_param
.
portal
||
""
;
if
(
GlobalConfig
.
isHttps
==
true
){
//https的时候替换所有80端口
GlobalConfig
.
portal
=
GlobalConfig
.
portal
.
replace
(
":80"
,
""
);
GlobalConfig
.
portal
=
GlobalConfig
.
replacePort
(
GlobalConfig
.
portal
,
":80"
,
""
);
}
GlobalConfig
.
userId
=
_param
.
userId
||
"0"
;
...
...
@@ -1091,7 +1091,7 @@ export default class MessageEntrance extends Emiter {
LogManager
.
userId
=
GlobalConfig
.
userId
;
//userId
LogManager
.
nodeId
=
GlobalConfig
.
nodeId
;
//nodeId
LogManager
.
userName
=
GlobalConfig
.
userName
;
//用户名称
LogManager
.
logUrl
=
GlobalConfig
.
logUrl
;
//日志服务器地址 //http://log.3mang.com
:8888
LogManager
.
logUrl
=
GlobalConfig
.
logUrl
;
//日志服务器地址 //http://log.3mang.com
loger
.
log
(
'加入课堂成功->'
);
loger
.
log
(
joinClassSuccessCallBackData
);
...
...
@@ -1524,6 +1524,10 @@ export default class MessageEntrance extends Emiter {
//是否自动开始(身份是host的时候才用到的)
GlobalConfig
.
isAutoStartClass
=
_data
.
autoRecord
||
0
;
GlobalConfig
.
logUrl
=
_data
.
logUrl
||
""
;
GlobalConfig
.
logUrl
=
GlobalConfig
.
logUrl
.
replace
(
"https://"
,
""
);
GlobalConfig
.
logUrl
=
GlobalConfig
.
logUrl
.
replace
(
"http://"
,
""
);
GlobalConfig
.
logUrl
=
GlobalConfig
.
locationProtocol
+
GlobalConfig
.
logUrl
;
GlobalConfig
.
serverTime
=
_data
.
serverTime
||
new
Date
().
getTime
();
//获取服务器时间戳
GlobalConfig
.
serverAndLoacTimeDistanc
=
(
new
Date
().
getTime
()
-
GlobalConfig
.
serverTime
)
/
1000
;
//当前系统时间和服务器时间的差值 (秒)
loger
.
warn
(
"服务器时间:"
+
GlobalConfig
.
serverTime
+
" 系统时间:"
+
new
Date
().
getTime
()
+
" 时间差:"
+
GlobalConfig
.
serverAndLoacTimeDistanc
);
...
...
@@ -1544,6 +1548,11 @@ export default class MessageEntrance extends Emiter {
GlobalConfig
.
DOCServerIP
=
GlobalConfig
.
docList
[
index
].
ip
||
""
;
GlobalConfig
.
DOCServerPort
=
GlobalConfig
.
docList
[
index
].
port
||
""
;
if
(
GlobalConfig
.
isHttps
){
//https的时候替换所有80端口
GlobalConfig
.
DOCServerPort
=
GlobalConfig
.
replacePort
(
GlobalConfig
.
DOCServerPort
,
"80"
,
""
);
}
}
//录制回放文件的下载地址
if
(
GlobalConfig
.
recordList
&&
GlobalConfig
.
recordList
.
length
>
0
)
{
...
...
@@ -2292,7 +2301,7 @@ export default class MessageEntrance extends Emiter {
GlobalConfig
.
portal
=
_param
.
portal
||
""
;
if
(
GlobalConfig
.
isHttps
==
true
){
//https的时候替换所有80端口
GlobalConfig
.
portal
=
GlobalConfig
.
portal
.
replace
(
":80"
,
""
);
GlobalConfig
.
portal
=
GlobalConfig
.
replacePort
(
GlobalConfig
.
portal
,
":80"
,
""
);
}
GlobalConfig
.
userRole
=
ApeConsts
.
normal
;
//*************很重要,录制回放的时候,身份模式是普通人********
...
...
src/EverSocket.js
查看文件 @
7344db6
...
...
@@ -36,7 +36,12 @@ class EverSocket extends Emiter {
}
this
.
_enableEverSocket
=
true
;
//this.wsURL = 'ws://' + ip + ':' + port;
if
(
port
){
this
.
wsURL
=
GlobalConfig
.
websocketProtocol
+
ip
+
':'
+
port
;
}
else
{
this
.
wsURL
=
GlobalConfig
.
websocketProtocol
+
ip
;
}
this
.
_newConnection
();
}
...
...
@@ -81,6 +86,10 @@ class EverSocket extends Emiter {
}
_newConnection
()
{
if
(
GlobalConfig
.
isHttps
==
true
){
//https的时候替换所有80端口
this
.
wsURL
=
GlobalConfig
.
replacePort
(
this
.
wsURL
,
":80"
,
""
);
}
this
.
websocket
=
new
WebSocket
(
this
.
wsURL
);
this
.
websocket
.
binaryType
=
'arraybuffer'
;
this
.
websocket
.
onopen
=
this
.
_onOpen
.
bind
(
this
);
...
...
src/GlobalConfig.js
查看文件 @
7344db6
...
...
@@ -335,6 +335,27 @@ class GlobalConfig {
}
loger
.
log
(
"videoCDNAddrList->"
,
this
.
videoCDNAddrList
);
}
//把IP中的端口换成指定端口
static
replacePort
(
_ipport
,
_curPort
,
_newPort
){
loger
.
warn
(
"替换端口->"
,
_ipport
,
_curPort
,
_newPort
);
if
(
!
_ipport
||!
_curPort
){
//数据不正确,直接返回原数据
return
_ipport
;
}
try
{
//判断要替换的端口是否在最后的位置,否则是不能替换的,比如替换":80"端口,如果地址是"xxx.xxx.xxx:8080" 不判断的话就会出错
let
lastIndex
=
_ipport
.
lastIndexOf
(
_curPort
);
if
((
_ipport
.
length
-
_curPort
.
length
)
==
lastIndex
){
let
ipportNew
=
_ipport
.
replace
(
_curPort
,
_newPort
);
return
ipportNew
}
return
_ipport
;
}
catch
(
err
){
return
_ipport
;
}
}
}
GlobalConfig
.
statusCode_0
=
{
"code"
:
0
,
message
:
"SDK 未初始化"
};
...
...
src/IpManager.js
查看文件 @
7344db6
...
...
@@ -15,7 +15,7 @@ const loger = Loger.getLoger('IpManager');
const
TIME_OUT
=
2000
;
//选点超时
const
MS_DEFAULT_PORT
=
"1935"
;
//默认流媒体端口
const
MCU_DEFAULT_PORT
=
"
7777"
;
//默认的mcu端口
const
MCU_DEFAULT_PORT
=
"
"
;
//默认的mcu端口 //7777
const
SPEED_TEST_PORT
=
'5555'
;
//测速端口(MCU/MS)
class
IpManager
extends
Emiter
{
...
...
请
注册
或
登录
后发表评论