Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
42bc0f7a
Unverified
提交
42bc0f7a
authored
2月 01, 2024
作者:
Iñaki Baz Castillo
提交者:
GitHub
2月 01, 2024
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
announced_ip can be a hostname as per spec (#1322)
上级
b6cce5be
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
69 行增加
和
64 行删除
+69
-64
CHANGELOG.md
CHANGELOG.md
+4
-0
Transport.ts
node/src/Transport.ts
+4
-4
test-WebRtcServer.ts
node/src/test/test-WebRtcServer.ts
+1
-1
test-WebRtcTransport.ts
node/src/test/test-WebRtcTransport.ts
+4
-5
data_structures.rs
rust/src/data_structures.rs
+9
-8
messages.rs
rust/src/messages.rs
+6
-5
router.rs
rust/src/router.rs
+7
-7
tests.rs
rust/src/router/plain_transport/tests.rs
+1
-1
tests.rs
rust/src/router/webrtc_transport/tests.rs
+2
-2
plain_transport.rs
rust/tests/integration/plain_transport.rs
+9
-9
webrtc_server.rs
rust/tests/integration/webrtc_server.rs
+3
-3
webrtc_transport.rs
rust/tests/integration/webrtc_transport.rs
+19
-19
没有找到文件。
CHANGELOG.md
浏览文件 @
42bc0f7a
# Changelog
### NEXT
-
`TransportListenInfo`
: announced ip can also be a hostname (
[
PR #1322
](
https://github.com/versatica/mediasoup/pull/1322
)
).
### 3.13.17
-
Fix prebuilt worker download (
[
PR #1319
](
https://github.com/versatica/mediasoup/pull/1319
)
by @brynrichards).
...
...
node/src/Transport.ts
浏览文件 @
42bc0f7a
...
...
@@ -72,8 +72,8 @@ export type TransportListenInfo = {
ip
:
string
;
/**
* Announced IPv4
or IPv6 (useful when running mediasoup behind NAT with
* private IP).
* Announced IPv4
, IPv6 or hostname (useful when running mediasoup behind NAT
*
with
private IP).
*/
announcedIp
?:
string
;
...
...
@@ -109,8 +109,8 @@ export type TransportListenIp = {
ip
:
string
;
/**
* Announced IPv4
or IPv6 (useful when running mediasoup behind NAT with
* private IP).
* Announced IPv4
, IPv6 or hostname (useful when running mediasoup behind NAT
*
with
private IP).
*/
announcedIp
?:
string
;
};
...
...
node/src/test/test-WebRtcServer.ts
浏览文件 @
42bc0f7a
...
...
@@ -48,7 +48,7 @@ test('worker.createWebRtcServer() succeeds', async () => {
{
protocol
:
'tcp'
,
ip
:
'127.0.0.1'
,
announcedIp
:
'
1.2.3.4
'
,
announcedIp
:
'
foo.bar.org
'
,
port
:
port2
,
},
],
...
...
node/src/test/test-WebRtcTransport.ts
浏览文件 @
42bc0f7a
...
...
@@ -68,13 +68,12 @@ test('router.createWebRtcTransport() succeeds', async () => {
ctx
.
router
!
.
observer
.
once
(
'newtransport'
,
onObserverNewTransport
);
// Create a separate transport here.
const
webRtcTransport
=
await
ctx
.
router
!
.
createWebRtcTransport
({
listenInfos
:
[
{
protocol
:
'udp'
,
ip
:
'127.0.0.1'
,
announcedIp
:
'9.9.9.1'
},
{
protocol
:
'tcp'
,
ip
:
'127.0.0.1'
,
announcedIp
:
'9.9.9.1'
},
{
protocol
:
'udp'
,
ip
:
'0.0.0.0'
,
announcedIp
:
'
9.9.9.2
'
},
{
protocol
:
'tcp'
,
ip
:
'0.0.0.0'
,
announcedIp
:
'
9.9.9.2
'
},
{
protocol
:
'udp'
,
ip
:
'0.0.0.0'
,
announcedIp
:
'
foo1.bar.org
'
},
{
protocol
:
'tcp'
,
ip
:
'0.0.0.0'
,
announcedIp
:
'
foo2.bar.org
'
},
{
protocol
:
'udp'
,
ip
:
'127.0.0.1'
,
announcedIp
:
undefined
},
{
protocol
:
'tcp'
,
ip
:
'127.0.0.1'
,
announcedIp
:
undefined
},
],
...
...
@@ -119,11 +118,11 @@ test('router.createWebRtcTransport() succeeds', async () => {
expect
(
iceCandidates
[
1
].
protocol
).
toBe
(
'tcp'
);
expect
(
iceCandidates
[
1
].
type
).
toBe
(
'host'
);
expect
(
iceCandidates
[
1
].
tcpType
).
toBe
(
'passive'
);
expect
(
iceCandidates
[
2
].
ip
).
toBe
(
'
9.9.9.2
'
);
expect
(
iceCandidates
[
2
].
ip
).
toBe
(
'
foo1.bar.org
'
);
expect
(
iceCandidates
[
2
].
protocol
).
toBe
(
'udp'
);
expect
(
iceCandidates
[
2
].
type
).
toBe
(
'host'
);
expect
(
iceCandidates
[
2
].
tcpType
).
toBeUndefined
();
expect
(
iceCandidates
[
3
].
ip
).
toBe
(
'
9.9.9.2
'
);
expect
(
iceCandidates
[
3
].
ip
).
toBe
(
'
foo2.bar.org
'
);
expect
(
iceCandidates
[
3
].
protocol
).
toBe
(
'tcp'
);
expect
(
iceCandidates
[
3
].
type
).
toBe
(
'host'
);
expect
(
iceCandidates
[
3
].
tcpType
).
toBe
(
'passive'
);
...
...
rust/src/data_structures.rs
浏览文件 @
42bc0f7a
...
...
@@ -51,16 +51,17 @@ impl AppData {
///
/// # Notes on usage
/// If you use "0.0.0.0" or "::" as ip value, then you need to also provide `announced_ip`.
#[derive(Debug,
C
opy,
C
lone,
Ord,
PartialOrd,
Eq,
PartialEq,
Hash,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
Ord,
PartialOrd,
Eq,
PartialEq,
Hash,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
pub
struct
ListenInfo
{
/// Network protocol.
pub
protocol
:
Protocol
,
/// Listening IPv4 or IPv6.
pub
ip
:
IpAddr
,
/// Announced IPv4 or IPv6 (useful when running mediasoup behind NAT with private IP).
/// Announced IPv4, IPv6 or hostname (useful when running mediasoup behind
/// NAT with private IP).
#[serde(skip_serializing_if
=
"Option::is_none"
)]
pub
announced_ip
:
Option
<
IpAddr
>
,
pub
announced_ip
:
Option
<
String
>
,
/// Listening port.
#[serde(skip_serializing_if
=
"Option::is_none"
)]
pub
port
:
Option
<
u16
>
,
...
...
@@ -76,14 +77,14 @@ pub struct ListenInfo {
}
impl
ListenInfo
{
pub
(
crate
)
fn
to_fbs
(
self
)
->
transport
::
ListenInfo
{
pub
(
crate
)
fn
to_fbs
(
&
self
)
->
transport
::
ListenInfo
{
transport
::
ListenInfo
{
protocol
:
match
self
.protocol
{
Protocol
::
Tcp
=>
transport
::
Protocol
::
Tcp
,
Protocol
::
Udp
=>
transport
::
Protocol
::
Udp
,
},
ip
:
self
.ip
.to_string
(),
announced_ip
:
self
.announced_ip
.map
(|
ip
|
ip
.to_string
()),
announced_ip
:
self
.announced_ip
.
clone
()
.
map
(|
ip
|
ip
.to_string
()),
port
:
self
.port
.unwrap_or
(
0
),
flags
:
Box
::
new
(
self
.flags
.unwrap_or_default
()
.to_fbs
()),
send_buffer_size
:
self
.send_buffer_size
.unwrap_or
(
0
),
...
...
@@ -229,8 +230,8 @@ pub struct IceCandidate {
pub
foundation
:
String
,
/// The assigned priority of the candidate.
pub
priority
:
u32
,
/// The IP address of the candidate.
pub
ip
:
IpAddr
,
/// The IP address o
r hostname o
f the candidate.
pub
ip
:
String
,
/// The protocol of the candidate.
pub
protocol
:
Protocol
,
/// The port for the candidate.
...
...
@@ -247,7 +248,7 @@ impl IceCandidate {
Self
{
foundation
:
candidate
.foundation
.clone
(),
priority
:
candidate
.priority
,
ip
:
candidate
.ip
.
parse
()
.expect
(
"Error parsing IP address"
),
ip
:
candidate
.ip
.
clone
(
),
protocol
:
Protocol
::
from_fbs
(
candidate
.protocol
),
port
:
candidate
.port
,
r
#
type
:
IceCandidateType
::
from_fbs
(
candidate
.type_
),
...
...
rust/src/messages.rs
浏览文件 @
42bc0f7a
...
...
@@ -921,8 +921,8 @@ impl RouterCreatePlainTransportData {
)
->
Self
{
Self
{
transport_id
,
listen_info
:
plain_transport_options
.listen_info
,
rtcp_listen_info
:
plain_transport_options
.rtcp_listen_info
,
listen_info
:
plain_transport_options
.listen_info
.clone
()
,
rtcp_listen_info
:
plain_transport_options
.rtcp_listen_info
.clone
()
,
rtcp_mux
:
plain_transport_options
.rtcp_mux
,
comedia
:
plain_transport_options
.comedia
,
enable_sctp
:
plain_transport_options
.enable_sctp
,
...
...
@@ -947,9 +947,10 @@ impl RouterCreatePlainTransportData {
sctp_send_buffer_size
:
self
.sctp_send_buffer_size
,
is_data_channel
:
self
.is_data_channel
,
}),
listen_info
:
Box
::
new
(
self
.listen_info
.to_fbs
()),
listen_info
:
Box
::
new
(
self
.listen_info
.
clone
()
.
to_fbs
()),
rtcp_listen_info
:
self
.rtcp_listen_info
.clone
()
.map
(|
listen_info
|
Box
::
new
(
listen_info
.to_fbs
())),
rtcp_mux
:
self
.rtcp_mux
,
comedia
:
self
.comedia
,
...
...
@@ -1055,7 +1056,7 @@ impl RouterCreatePipeTransportData {
)
->
Self
{
Self
{
transport_id
,
listen_info
:
pipe_transport_options
.listen_info
,
listen_info
:
pipe_transport_options
.listen_info
.clone
()
,
enable_sctp
:
pipe_transport_options
.enable_sctp
,
num_sctp_streams
:
pipe_transport_options
.num_sctp_streams
,
max_sctp_message_size
:
pipe_transport_options
.max_sctp_message_size
,
...
...
@@ -1078,7 +1079,7 @@ impl RouterCreatePipeTransportData {
sctp_send_buffer_size
:
self
.sctp_send_buffer_size
,
is_data_channel
:
self
.is_data_channel
,
}),
listen_info
:
Box
::
new
(
self
.listen_info
.to_fbs
()),
listen_info
:
Box
::
new
(
self
.listen_info
.
clone
()
.
to_fbs
()),
enable_rtx
:
self
.enable_rtx
,
enable_srtp
:
self
.enable_srtp
,
}
...
...
rust/src/router.rs
浏览文件 @
42bc0f7a
...
...
@@ -608,7 +608,7 @@ impl Router {
/// ListenInfo {
/// protocol: Protocol::Udp,
/// ip: IpAddr::V4(Ipv4Addr::LOCALHOST),
/// announced_ip: Some("9.9.9.1".
parse().unwrap
()),
/// announced_ip: Some("9.9.9.1".
to_string
()),
/// port: None,
/// flags: None,
/// send_buffer_size: None,
...
...
@@ -696,7 +696,7 @@ impl Router {
/// .create_pipe_transport(PipeTransportOptions::new(ListenInfo {
/// protocol: Protocol::Udp,
/// ip: IpAddr::V4(Ipv4Addr::LOCALHOST),
/// announced_ip: Some("9.9.9.1".
parse().unwrap
()),
/// announced_ip: Some("9.9.9.1".
to_string
()),
/// port: None,
/// flags: None,
/// send_buffer_size: None,
...
...
@@ -762,7 +762,7 @@ impl Router {
/// .create_plain_transport(PlainTransportOptions::new(ListenInfo {
/// protocol: Protocol::Udp,
/// ip: IpAddr::V4(Ipv4Addr::LOCALHOST),
/// announced_ip: Some("9.9.9.1".
parse().unwrap
()),
/// announced_ip: Some("9.9.9.1".
to_string
()),
/// port: None,
/// flags: None,
/// send_buffer_size: None,
...
...
@@ -973,7 +973,7 @@ impl Router {
/// ListenInfo {
/// protocol: Protocol::Udp,
/// ip: IpAddr::V4(Ipv4Addr::LOCALHOST),
/// announced_ip: Some("9.9.9.1".
parse().unwrap
()),
/// announced_ip: Some("9.9.9.1".
to_string
()),
/// port: None,
/// flags: None,
/// send_buffer_size: None,
...
...
@@ -1016,7 +1016,7 @@ impl Router {
/// ListenInfo {
/// protocol: Protocol::Udp,
/// ip: IpAddr::V4(Ipv4Addr::LOCALHOST),
/// announced_ip: Some("9.9.9.1".
parse().unwrap
()),
/// announced_ip: Some("9.9.9.1".
to_string
()),
/// port: None,
/// flags: None,
/// send_buffer_size: None,
...
...
@@ -1202,7 +1202,7 @@ impl Router {
/// ListenInfo {
/// protocol: Protocol::Udp,
/// ip: IpAddr::V4(Ipv4Addr::LOCALHOST),
/// announced_ip: Some("9.9.9.1".
parse().unwrap
()),
/// announced_ip: Some("9.9.9.1".
to_string
()),
/// port: None,
/// flags: None,
/// send_buffer_size: None,
...
...
@@ -1234,7 +1234,7 @@ impl Router {
/// ListenInfo {
/// protocol: Protocol::Udp,
/// ip: IpAddr::V4(Ipv4Addr::LOCALHOST),
/// announced_ip: Some("9.9.9.1".
parse().unwrap
()),
/// announced_ip: Some("9.9.9.1".
to_string
()),
/// port: None,
/// flags: None,
/// send_buffer_size: None,
...
...
rust/src/router/plain_transport/tests.rs
浏览文件 @
42bc0f7a
...
...
@@ -40,7 +40,7 @@ fn router_close_event() {
let
mut
plain_transport_options
=
PlainTransportOptions
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"4.4.4.4"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"4.4.4.4"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
rust/src/router/webrtc_transport/tests.rs
浏览文件 @
42bc0f7a
...
...
@@ -132,7 +132,7 @@ fn create_with_webrtc_server_succeeds() {
{
let
ice_candidates
=
transport
.ice_candidates
();
assert_eq!
(
ice_candidates
.len
(),
1
);
assert_eq!
(
ice_candidates
[
0
]
.ip
,
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
)
);
assert_eq!
(
ice_candidates
[
0
]
.ip
,
"127.0.0.1"
);
assert_eq!
(
ice_candidates
[
0
]
.protocol
,
Protocol
::
Tcp
);
assert_eq!
(
ice_candidates
[
0
]
.port
,
port2
);
assert_eq!
(
ice_candidates
[
0
]
.r
#
type
,
IceCandidateType
::
Host
);
...
...
@@ -233,7 +233,7 @@ fn router_close_event() {
WebRtcTransportListenInfos
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
rust/tests/integration/plain_transport.rs
浏览文件 @
42bc0f7a
...
...
@@ -94,7 +94,7 @@ fn create_succeeds() {
let
mut
plain_transport_options
=
PlainTransportOptions
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"4.4.4.4"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"4.4.4.4"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -133,7 +133,7 @@ fn create_succeeds() {
let
mut
plain_transport_options
=
PlainTransportOptions
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -286,7 +286,7 @@ fn create_with_fixed_port_succeeds() {
PlainTransportOptions
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"4.4.4.4"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"4.4.4.4"
.
to_string
()),
port
:
Some
(
port
),
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -310,7 +310,7 @@ fn weak() {
let
mut
plain_transport_options
=
PlainTransportOptions
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"4.4.4.4"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"4.4.4.4"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -344,7 +344,7 @@ fn create_enable_srtp_succeeds() {
let
mut
plain_transport_options
=
PlainTransportOptions
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -532,7 +532,7 @@ fn get_stats_succeeds() {
let
mut
plain_transport_options
=
PlainTransportOptions
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"4.4.4.4"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"4.4.4.4"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -590,7 +590,7 @@ fn connect_succeeds() {
let
mut
plain_transport_options
=
PlainTransportOptions
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"4.4.4.4"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"4.4.4.4"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -666,7 +666,7 @@ fn connect_wrong_arguments() {
let
mut
plain_transport_options
=
PlainTransportOptions
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"4.4.4.4"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"4.4.4.4"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -707,7 +707,7 @@ fn close_event() {
let
mut
plain_transport_options
=
PlainTransportOptions
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"4.4.4.4"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"4.4.4.4"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
rust/tests/integration/webrtc_server.rs
浏览文件 @
42bc0f7a
...
...
@@ -71,7 +71,7 @@ fn create_webrtc_server_succeeds() {
let
listen_infos
=
listen_infos
.insert
(
ListenInfo
{
protocol
:
Protocol
::
Tcp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
IpAddr
::
V4
(
Ipv4Addr
::
new
(
1
,
2
,
3
,
4
)
)),
announced_ip
:
Some
(
"foo.bar.org"
.to_string
(
)),
port
:
Some
(
port2
),
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -167,7 +167,7 @@ fn create_webrtc_server_without_specifying_port_succeeds() {
let
listen_infos
=
listen_infos
.insert
(
ListenInfo
{
protocol
:
Protocol
::
Tcp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
IpAddr
::
V4
(
Ipv4Addr
::
new
(
1
,
2
,
3
,
4
)
)),
announced_ip
:
Some
(
"1.2.3.4"
.to_string
(
)),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -283,7 +283,7 @@ fn unavailable_infos_fails() {
let
listen_infos
=
listen_infos
.insert
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
new
(
127
,
0
,
0
,
1
)),
announced_ip
:
Some
(
IpAddr
::
V4
(
Ipv4Addr
::
new
(
1
,
2
,
3
,
4
)
)),
announced_ip
:
Some
(
"1.2.3.4"
.to_string
(
)),
port
:
Some
(
port1
),
flags
:
None
,
send_buffer_size
:
None
,
...
...
rust/tests/integration/webrtc_transport.rs
浏览文件 @
42bc0f7a
...
...
@@ -98,7 +98,7 @@ fn create_succeeds() {
WebRtcTransportListenInfos
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -136,7 +136,7 @@ fn create_succeeds() {
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -145,7 +145,7 @@ fn create_succeeds() {
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
UNSPECIFIED
),
announced_ip
:
Some
(
"
9.9.9.2"
.parse
()
.unwrap
()),
announced_ip
:
Some
(
"
foo1.bar.org"
.to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -200,19 +200,19 @@ fn create_succeeds() {
{
let
ice_candidates
=
transport1
.ice_candidates
();
assert_eq!
(
ice_candidates
.len
(),
3
);
assert_eq!
(
ice_candidates
[
0
]
.ip
,
"9.9.9.1"
.parse
::
<
IpAddr
>
()
.unwrap
()
);
assert_eq!
(
ice_candidates
[
0
]
.ip
,
"9.9.9.1"
);
assert_eq!
(
ice_candidates
[
0
]
.protocol
,
Protocol
::
Udp
);
assert_eq!
(
ice_candidates
[
0
]
.r
#
type
,
IceCandidateType
::
Host
);
assert_eq!
(
ice_candidates
[
0
]
.tcp_type
,
None
);
assert_eq!
(
ice_candidates
[
1
]
.ip
,
"
9.9.9.2"
.parse
::
<
IpAddr
>
()
.unwrap
()
);
assert_eq!
(
ice_candidates
[
1
]
.ip
,
"
foo1.bar.org"
);
assert_eq!
(
ice_candidates
[
1
]
.protocol
,
Protocol
::
Udp
);
assert_eq!
(
ice_candidates
[
1
]
.r
#
type
,
IceCandidateType
::
Host
);
assert_eq!
(
ice_candidates
[
1
]
.tcp_type
,
None
);
assert_eq!
(
ice_candidates
[
2
]
.ip
,
"127.0.0.1"
.parse
::
<
IpAddr
>
()
.unwrap
()
);
assert_eq!
(
ice_candidates
[
2
]
.ip
,
"127.0.0.1"
);
assert_eq!
(
ice_candidates
[
2
]
.protocol
,
Protocol
::
Udp
);
assert_eq!
(
ice_candidates
[
2
]
.r
#
type
,
IceCandidateType
::
Host
);
assert_eq!
(
ice_candidates
[
2
]
.tcp_type
,
None
);
assert_eq!
(
ice_candidates
[
2
]
.ip
,
"127.0.0.1"
.parse
::
<
IpAddr
>
()
.unwrap
()
);
assert_eq!
(
ice_candidates
[
2
]
.ip
,
"127.0.0.1"
);
assert_eq!
(
ice_candidates
[
2
]
.protocol
,
Protocol
::
Udp
);
assert_eq!
(
ice_candidates
[
2
]
.r
#
type
,
IceCandidateType
::
Host
);
assert_eq!
(
ice_candidates
[
2
]
.tcp_type
,
None
);
...
...
@@ -265,7 +265,7 @@ fn create_with_fixed_port_succeeds() {
WebRtcTransportOptions
::
new
(
WebRtcTransportListenInfos
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
Some
(
port
),
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -289,7 +289,7 @@ fn weak() {
WebRtcTransportListenInfos
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -343,7 +343,7 @@ fn get_stats_succeeds() {
WebRtcTransportListenInfos
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -395,7 +395,7 @@ fn connect_succeeds() {
WebRtcTransportListenInfos
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -445,7 +445,7 @@ fn set_max_incoming_bitrate_succeeds() {
WebRtcTransportListenInfos
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -478,7 +478,7 @@ fn set_max_outgoing_bitrate_succeeds() {
WebRtcTransportListenInfos
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -511,7 +511,7 @@ fn set_min_outgoing_bitrate_succeeds() {
WebRtcTransportListenInfos
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -544,7 +544,7 @@ fn set_max_outgoing_bitrate_fails_if_value_is_lower_than_current_min_limit() {
WebRtcTransportListenInfos
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -582,7 +582,7 @@ fn set_min_outgoing_bitrate_fails_if_value_is_higher_than_current_max_limit() {
WebRtcTransportListenInfos
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -620,7 +620,7 @@ fn restart_ice_succeeds() {
WebRtcTransportListenInfos
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -656,7 +656,7 @@ fn enable_trace_event_succeeds() {
WebRtcTransportListenInfos
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
@@ -732,7 +732,7 @@ fn close_event() {
WebRtcTransportListenInfos
::
new
(
ListenInfo
{
protocol
:
Protocol
::
Udp
,
ip
:
IpAddr
::
V4
(
Ipv4Addr
::
LOCALHOST
),
announced_ip
:
Some
(
"9.9.9.1"
.
parse
()
.unwrap
()),
announced_ip
:
Some
(
"9.9.9.1"
.
to_string
()),
port
:
None
,
flags
:
None
,
send_buffer_size
:
None
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论