This repository was archived by the owner on Aug 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add lookup_host and upgrade to v0.1.4
- Loading branch information
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "webrtc-rs-util" | ||
version = "0.1.3" | ||
version = "0.1.4" | ||
authors = ["Rain Liu <[email protected]>"] | ||
edition = "2018" | ||
description = "Utilities for WebRTC.rs stack" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use super::*; | ||
|
||
#[tokio::test] | ||
async fn test_conn_lookup_host() -> Result<()> { | ||
let stun_serv_addr = "stun1.l.google.com:19302"; | ||
|
||
let ipv4_addr = lookup_host(true, stun_serv_addr).await?; | ||
assert!( | ||
ipv4_addr.is_ipv4(), | ||
"expected ipv4 but got ipv6: {}", | ||
ipv4_addr | ||
); | ||
|
||
let ipv6_addr = lookup_host(false, stun_serv_addr).await?; | ||
assert!( | ||
ipv6_addr.is_ipv6(), | ||
"expected ipv6 but got ipv4: {}", | ||
ipv6_addr | ||
); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters