Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
f8b61863
提交
f8b61863
authored
3月 16, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
0.7.0: Breaking change: rename rtcListenIPv4/6 with rtpIPv4/6
上级
99bc2578
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
49 行增加
和
49 行删除
+49
-49
Server.js
lib/Server.js
+12
-12
mediasoup.js
lib/mediasoup.js
+4
-4
package.json
package.json
+1
-1
test_mediasoup.js
test/test_mediasoup.js
+2
-2
Settings.hpp
worker/include/Settings.hpp
+16
-16
IceCandidate.cpp
worker/src/RTC/IceCandidate.cpp
+4
-4
TcpServer.cpp
worker/src/RTC/TcpServer.cpp
+6
-6
UdpSocket.cpp
worker/src/RTC/UdpSocket.cpp
+4
-4
Settings.cpp
worker/src/Settings.cpp
+0
-0
没有找到文件。
lib/Server.js
浏览文件 @
f8b61863
...
@@ -14,10 +14,10 @@ const VALID_WORKER_PARAMETERS =
...
@@ -14,10 +14,10 @@ const VALID_WORKER_PARAMETERS =
[
[
'logLevel'
,
'logLevel'
,
'logTags'
,
'logTags'
,
'rtc
Listen
IPv4'
,
'rtcIPv4'
,
'rtc
Listen
IPv6'
,
'rtcIPv6'
,
'rtcAnnounced
Listen
IPv4'
,
'rtcAnnouncedIPv4'
,
'rtcAnnounced
Listen
IPv6'
,
'rtcAnnouncedIPv6'
,
'rtcMinPort'
,
'rtcMinPort'
,
'rtcMaxPort'
,
'rtcMaxPort'
,
'dtlsCertificateFile'
,
'dtlsCertificateFile'
,
...
@@ -58,17 +58,17 @@ class Server extends EventEmitter
...
@@ -58,17 +58,17 @@ class Server extends EventEmitter
if
(
!
check
.
array
(
options
.
logTags
))
if
(
!
check
.
array
(
options
.
logTags
))
options
.
logTags
=
[];
options
.
logTags
=
[];
if
(
options
.
rtc
ListenIPv4
===
null
||
options
.
rtcListen
IPv4
===
undefined
)
if
(
options
.
rtc
IPv4
===
null
||
options
.
rtc
IPv4
===
undefined
)
delete
options
.
rtc
Listen
IPv4
;
delete
options
.
rtcIPv4
;
if
(
options
.
rtc
ListenIPv6
===
null
||
options
.
rtcListen
IPv6
===
undefined
)
if
(
options
.
rtc
IPv6
===
null
||
options
.
rtc
IPv6
===
undefined
)
delete
options
.
rtc
Listen
IPv6
;
delete
options
.
rtcIPv6
;
if
(
!
options
.
rtcAnnounced
ListenIPv4
||
options
.
rtcListen
IPv4
===
false
)
if
(
!
options
.
rtcAnnounced
IPv4
||
options
.
rtc
IPv4
===
false
)
delete
options
.
rtcAnnounced
Listen
IPv4
;
delete
options
.
rtcAnnouncedIPv4
;
if
(
!
options
.
rtcAnnounced
ListenIPv6
||
options
.
rtcListen
IPv6
===
false
)
if
(
!
options
.
rtcAnnounced
IPv6
||
options
.
rtc
IPv6
===
false
)
delete
options
.
rtcAnnounced
Listen
IPv6
;
delete
options
.
rtcAnnouncedIPv6
;
if
(
!
check
.
greaterOrEqual
(
options
.
rtcMinPort
,
1024
))
if
(
!
check
.
greaterOrEqual
(
options
.
rtcMinPort
,
1024
))
options
.
rtcMinPort
=
10000
;
options
.
rtcMinPort
=
10000
;
...
...
lib/mediasoup.js
浏览文件 @
f8b61863
...
@@ -22,13 +22,13 @@ module.exports =
...
@@ -22,13 +22,13 @@ module.exports =
* @param {string} [options.logLevel='debug'] - Log level. Valid values are
* @param {string} [options.logLevel='debug'] - Log level. Valid values are
* 'debug', 'warn', 'error'.
* 'debug', 'warn', 'error'.
* @param {array} [options.logTags] - Log tags.
* @param {array} [options.logTags] - Log tags.
* @param {string|boolean} [options.rtc
Listen
IPv4=true] - IPv4 for RTC. Valid
* @param {string|boolean} [options.rtcIPv4=true] - IPv4 for RTC. Valid
* values are a IPv4, `true` (auto-detect) and `false` (disabled).
* values are a IPv4, `true` (auto-detect) and `false` (disabled).
* @param {string|boolean} [options.rtc
Listen
IPv6=true] - IPv6 for RTC. Valid
* @param {string|boolean} [options.rtcIPv6=true] - IPv6 for RTC. Valid
* values are a IPv6, `true` (auto-detect) and `false` (disabled).
* values are a IPv6, `true` (auto-detect) and `false` (disabled).
* @param {string} [options.rtcAnnounced
Listen
IPv4] - Announced IPv4 for RTC. Valid
* @param {string} [options.rtcAnnouncedIPv4] - Announced IPv4 for RTC. Valid
* value is a IPv4.
* value is a IPv4.
* @param {string} [options.rtcAnnounced
Listen
IPv6] - Announced IPv6 for RTC. Valid
* @param {string} [options.rtcAnnouncedIPv6] - Announced IPv6 for RTC. Valid
* value is a IPv6.
* value is a IPv6.
* @param {number} [options.rtcMinPort=10000] - Minimun RTC port.
* @param {number} [options.rtcMinPort=10000] - Minimun RTC port.
* @param {number} [options.rtcMaxPort=59999] - Maximum RTC port.
* @param {number} [options.rtcMaxPort=59999] - Maximum RTC port.
...
...
package.json
浏览文件 @
f8b61863
{
{
"name"
:
"
mediasoup
"
,
"name"
:
"
mediasoup
"
,
"version"
:
"0.
6
.0"
,
"version"
:
"0.
7
.0"
,
"description"
:
"Powerful WebRTC SFU for Node.js"
,
"description"
:
"Powerful WebRTC SFU for Node.js"
,
"main"
:
"lib/mediasoup.js"
,
"main"
:
"lib/mediasoup.js"
,
"repository"
:
{
"repository"
:
{
...
...
test/test_mediasoup.js
浏览文件 @
f8b61863
...
@@ -63,9 +63,9 @@ tap.test('mediasoup.Server() with wrong options must fail', { timeout: 2000 }, (
...
@@ -63,9 +63,9 @@ tap.test('mediasoup.Server() with wrong options must fail', { timeout: 2000 }, (
});
});
});
});
tap
.
test
(
'mediasoup.Server() with non existing rtc
Listen
IPv4 IP must fail'
,
{
timeout
:
2000
},
(
t
)
=>
tap
.
test
(
'mediasoup.Server() with non existing rtcIPv4 IP must fail'
,
{
timeout
:
2000
},
(
t
)
=>
{
{
let
server
=
mediasoup
.
Server
({
rtc
Listen
IPv4
:
'1.2.3.4'
});
let
server
=
mediasoup
.
Server
({
rtcIPv4
:
'1.2.3.4'
});
server
.
on
(
'close'
,
(
error
)
=>
server
.
on
(
'close'
,
(
error
)
=>
{
{
...
...
worker/include/Settings.hpp
浏览文件 @
f8b61863
...
@@ -26,21 +26,21 @@ public:
...
@@ -26,21 +26,21 @@ public:
// Struct holding the configuration.
// Struct holding the configuration.
struct
Configuration
struct
Configuration
{
{
LogLevel
logLevel
{
LogLevel
::
LOG_DEBUG
};
LogLevel
logLevel
{
LogLevel
::
LOG_DEBUG
};
struct
LogTags
logTags
;
struct
LogTags
logTags
;
std
::
string
rtc
Listen
IPv4
;
std
::
string
rtcIPv4
;
std
::
string
rtc
Listen
IPv6
;
std
::
string
rtcIPv6
;
std
::
string
rtcAnnounced
Listen
IPv4
;
std
::
string
rtcAnnouncedIPv4
;
std
::
string
rtcAnnounced
Listen
IPv6
;
std
::
string
rtcAnnouncedIPv6
;
uint16_t
rtcMinPort
{
10000
};
uint16_t
rtcMinPort
{
10000
};
uint16_t
rtcMaxPort
{
59999
};
uint16_t
rtcMaxPort
{
59999
};
std
::
string
dtlsCertificateFile
;
std
::
string
dtlsCertificateFile
;
std
::
string
dtlsPrivateKeyFile
;
std
::
string
dtlsPrivateKeyFile
;
// Private fields.
// Private fields.
bool
hasIPv4
{
false
};
bool
hasIPv4
{
false
};
bool
hasIPv6
{
false
};
bool
hasIPv6
{
false
};
bool
hasAnnouncedIPv4
{
false
};
bool
hasAnnouncedIPv4
{
false
};
bool
hasAnnouncedIPv6
{
false
};
bool
hasAnnouncedIPv6
{
false
};
};
};
public
:
public
:
...
@@ -49,12 +49,12 @@ public:
...
@@ -49,12 +49,12 @@ public:
static
void
HandleRequest
(
Channel
::
Request
*
request
);
static
void
HandleRequest
(
Channel
::
Request
*
request
);
private
:
private
:
static
void
SetDefaultRtc
Listen
IP
(
int
requested_family
);
static
void
SetDefaultRtcIP
(
int
requested_family
);
static
void
SetLogLevel
(
std
::
string
&
level
);
static
void
SetLogLevel
(
std
::
string
&
level
);
static
void
SetRtc
Listen
IPv4
(
const
std
::
string
&
ip
);
static
void
SetRtcIPv4
(
const
std
::
string
&
ip
);
static
void
SetRtc
Listen
IPv6
(
const
std
::
string
&
ip
);
static
void
SetRtcIPv6
(
const
std
::
string
&
ip
);
static
void
SetRtcAnnounced
Listen
IPv4
(
const
std
::
string
&
ip
);
static
void
SetRtcAnnouncedIPv4
(
const
std
::
string
&
ip
);
static
void
SetRtcAnnounced
Listen
IPv6
(
const
std
::
string
&
ip
);
static
void
SetRtcAnnouncedIPv6
(
const
std
::
string
&
ip
);
static
void
SetRtcPorts
();
static
void
SetRtcPorts
();
static
void
SetDtlsCertificateAndPrivateKeyFiles
();
static
void
SetDtlsCertificateAndPrivateKeyFiles
();
static
void
SetLogTags
(
std
::
vector
<
std
::
string
>&
tags
);
static
void
SetLogTags
(
std
::
vector
<
std
::
string
>&
tags
);
...
...
worker/src/RTC/IceCandidate.cpp
浏览文件 @
f8b61863
...
@@ -21,7 +21,7 @@ namespace RTC
...
@@ -21,7 +21,7 @@ namespace RTC
case
AF_INET
:
case
AF_INET
:
{
{
if
(
Settings
::
configuration
.
hasAnnouncedIPv4
)
if
(
Settings
::
configuration
.
hasAnnouncedIPv4
)
this
->
ip
=
Settings
::
configuration
.
rtcAnnounced
Listen
IPv4
;
this
->
ip
=
Settings
::
configuration
.
rtcAnnouncedIPv4
;
else
else
this
->
ip
=
udpSocket
->
GetLocalIP
();
this
->
ip
=
udpSocket
->
GetLocalIP
();
...
@@ -31,7 +31,7 @@ namespace RTC
...
@@ -31,7 +31,7 @@ namespace RTC
case
AF_INET6
:
case
AF_INET6
:
{
{
if
(
Settings
::
configuration
.
hasAnnouncedIPv6
)
if
(
Settings
::
configuration
.
hasAnnouncedIPv6
)
this
->
ip
=
Settings
::
configuration
.
rtcAnnounced
Listen
IPv6
;
this
->
ip
=
Settings
::
configuration
.
rtcAnnouncedIPv6
;
else
else
this
->
ip
=
udpSocket
->
GetLocalIP
();
this
->
ip
=
udpSocket
->
GetLocalIP
();
...
@@ -54,7 +54,7 @@ namespace RTC
...
@@ -54,7 +54,7 @@ namespace RTC
case
AF_INET
:
case
AF_INET
:
{
{
if
(
Settings
::
configuration
.
hasAnnouncedIPv4
)
if
(
Settings
::
configuration
.
hasAnnouncedIPv4
)
this
->
ip
=
Settings
::
configuration
.
rtcAnnounced
Listen
IPv4
;
this
->
ip
=
Settings
::
configuration
.
rtcAnnouncedIPv4
;
else
else
this
->
ip
=
tcpServer
->
GetLocalIP
();
this
->
ip
=
tcpServer
->
GetLocalIP
();
...
@@ -64,7 +64,7 @@ namespace RTC
...
@@ -64,7 +64,7 @@ namespace RTC
case
AF_INET6
:
case
AF_INET6
:
{
{
if
(
Settings
::
configuration
.
hasAnnouncedIPv6
)
if
(
Settings
::
configuration
.
hasAnnouncedIPv6
)
this
->
ip
=
Settings
::
configuration
.
rtcAnnounced
Listen
IPv6
;
this
->
ip
=
Settings
::
configuration
.
rtcAnnouncedIPv6
;
else
else
this
->
ip
=
tcpServer
->
GetLocalIP
();
this
->
ip
=
tcpServer
->
GetLocalIP
();
...
...
worker/src/RTC/TcpServer.cpp
浏览文件 @
f8b61863
...
@@ -39,16 +39,16 @@ namespace RTC
...
@@ -39,16 +39,16 @@ namespace RTC
int
err
;
int
err
;
if
(
!
Settings
::
configuration
.
rtc
Listen
IPv4
.
empty
())
if
(
!
Settings
::
configuration
.
rtcIPv4
.
empty
())
{
{
err
=
uv_ip4_addr
(
Settings
::
configuration
.
rtc
Listen
IPv4
.
c_str
(),
0
,
(
struct
sockaddr_in
*
)
&
RTC
::
TcpServer
::
sockaddrStorageIPv4
);
err
=
uv_ip4_addr
(
Settings
::
configuration
.
rtcIPv4
.
c_str
(),
0
,
(
struct
sockaddr_in
*
)
&
RTC
::
TcpServer
::
sockaddrStorageIPv4
);
if
(
err
)
if
(
err
)
MS_THROW_ERROR
(
"uv_ipv4_addr() failed: %s"
,
uv_strerror
(
err
));
MS_THROW_ERROR
(
"uv_ipv4_addr() failed: %s"
,
uv_strerror
(
err
));
}
}
if
(
!
Settings
::
configuration
.
rtc
Listen
IPv6
.
empty
())
if
(
!
Settings
::
configuration
.
rtcIPv6
.
empty
())
{
{
err
=
uv_ip6_addr
(
Settings
::
configuration
.
rtc
Listen
IPv6
.
c_str
(),
0
,
(
struct
sockaddr_in6
*
)
&
RTC
::
TcpServer
::
sockaddrStorageIPv6
);
err
=
uv_ip6_addr
(
Settings
::
configuration
.
rtcIPv6
.
c_str
(),
0
,
(
struct
sockaddr_in6
*
)
&
RTC
::
TcpServer
::
sockaddrStorageIPv6
);
if
(
err
)
if
(
err
)
MS_THROW_ERROR
(
"uv_ipv6_addr() failed: %s"
,
uv_strerror
(
err
));
MS_THROW_ERROR
(
"uv_ipv6_addr() failed: %s"
,
uv_strerror
(
err
));
}
}
...
@@ -90,13 +90,13 @@ namespace RTC
...
@@ -90,13 +90,13 @@ namespace RTC
case
AF_INET
:
case
AF_INET
:
available_ports
=
&
RTC
::
TcpServer
::
availableIPv4Ports
;
available_ports
=
&
RTC
::
TcpServer
::
availableIPv4Ports
;
bind_addr
=
RTC
::
TcpServer
::
sockaddrStorageIPv4
;
bind_addr
=
RTC
::
TcpServer
::
sockaddrStorageIPv4
;
listen_ip
=
Settings
::
configuration
.
rtc
Listen
IPv4
.
c_str
();
listen_ip
=
Settings
::
configuration
.
rtcIPv4
.
c_str
();
break
;
break
;
case
AF_INET6
:
case
AF_INET6
:
available_ports
=
&
RTC
::
TcpServer
::
availableIPv6Ports
;
available_ports
=
&
RTC
::
TcpServer
::
availableIPv6Ports
;
bind_addr
=
RTC
::
TcpServer
::
sockaddrStorageIPv6
;
bind_addr
=
RTC
::
TcpServer
::
sockaddrStorageIPv6
;
listen_ip
=
Settings
::
configuration
.
rtc
Listen
IPv6
.
c_str
();
listen_ip
=
Settings
::
configuration
.
rtcIPv6
.
c_str
();
// Don't also bind into IPv4 when listening in IPv6.
// Don't also bind into IPv4 when listening in IPv6.
flags
|=
UV_TCP_IPV6ONLY
;
flags
|=
UV_TCP_IPV6ONLY
;
break
;
break
;
...
...
worker/src/RTC/UdpSocket.cpp
浏览文件 @
f8b61863
...
@@ -40,14 +40,14 @@ namespace RTC
...
@@ -40,14 +40,14 @@ namespace RTC
if
(
Settings
::
configuration
.
hasIPv4
)
if
(
Settings
::
configuration
.
hasIPv4
)
{
{
err
=
uv_ip4_addr
(
Settings
::
configuration
.
rtc
Listen
IPv4
.
c_str
(),
0
,
(
struct
sockaddr_in
*
)
&
RTC
::
UdpSocket
::
sockaddrStorageIPv4
);
err
=
uv_ip4_addr
(
Settings
::
configuration
.
rtcIPv4
.
c_str
(),
0
,
(
struct
sockaddr_in
*
)
&
RTC
::
UdpSocket
::
sockaddrStorageIPv4
);
if
(
err
)
if
(
err
)
MS_THROW_ERROR
(
"uv_ipv4_addr() failed: %s"
,
uv_strerror
(
err
));
MS_THROW_ERROR
(
"uv_ipv4_addr() failed: %s"
,
uv_strerror
(
err
));
}
}
if
(
Settings
::
configuration
.
hasIPv6
)
if
(
Settings
::
configuration
.
hasIPv6
)
{
{
err
=
uv_ip6_addr
(
Settings
::
configuration
.
rtc
Listen
IPv6
.
c_str
(),
0
,
(
struct
sockaddr_in6
*
)
&
RTC
::
UdpSocket
::
sockaddrStorageIPv6
);
err
=
uv_ip6_addr
(
Settings
::
configuration
.
rtcIPv6
.
c_str
(),
0
,
(
struct
sockaddr_in6
*
)
&
RTC
::
UdpSocket
::
sockaddrStorageIPv6
);
if
(
err
)
if
(
err
)
MS_THROW_ERROR
(
"uv_ipv6_addr() failed: %s"
,
uv_strerror
(
err
));
MS_THROW_ERROR
(
"uv_ipv6_addr() failed: %s"
,
uv_strerror
(
err
));
}
}
...
@@ -89,13 +89,13 @@ namespace RTC
...
@@ -89,13 +89,13 @@ namespace RTC
case
AF_INET
:
case
AF_INET
:
available_ports
=
&
RTC
::
UdpSocket
::
availableIPv4Ports
;
available_ports
=
&
RTC
::
UdpSocket
::
availableIPv4Ports
;
bind_addr
=
RTC
::
UdpSocket
::
sockaddrStorageIPv4
;
bind_addr
=
RTC
::
UdpSocket
::
sockaddrStorageIPv4
;
listen_ip
=
Settings
::
configuration
.
rtc
Listen
IPv4
.
c_str
();
listen_ip
=
Settings
::
configuration
.
rtcIPv4
.
c_str
();
break
;
break
;
case
AF_INET6
:
case
AF_INET6
:
available_ports
=
&
RTC
::
UdpSocket
::
availableIPv6Ports
;
available_ports
=
&
RTC
::
UdpSocket
::
availableIPv6Ports
;
bind_addr
=
RTC
::
UdpSocket
::
sockaddrStorageIPv6
;
bind_addr
=
RTC
::
UdpSocket
::
sockaddrStorageIPv6
;
listen_ip
=
Settings
::
configuration
.
rtc
Listen
IPv6
.
c_str
();
listen_ip
=
Settings
::
configuration
.
rtcIPv6
.
c_str
();
// Don't also bind into IPv4 when listening in IPv6.
// Don't also bind into IPv4 when listening in IPv6.
flags
|=
UV_UDP_IPV6ONLY
;
flags
|=
UV_UDP_IPV6ONLY
;
break
;
break
;
...
...
worker/src/Settings.cpp
浏览文件 @
f8b61863
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论