Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ futures-timer = "3"
instant = "0.1.11"
libp2p-identity = { version = "0.1", path = "../identity", features = ["peerid", "ed25519"] }
log = "0.4"
multiaddr = { version = "0.17.0" }
multiaddr = { version = "0.17.1" }
multihash = { version = "0.17.0", default-features = false, features = ["std", "multihash-impl", "identity", "sha2"] }
multistream-select = { version = "0.12.1", path = "../misc/multistream-select" }
once_cell = "1.17.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/distributed-key-value-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ async-trait = "0.1"
env_logger = "0.10"
futures = "0.3.27"
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "mdns", "mplex", "noise", "macros", "tcp", "websocket", "yamux"] }
multiaddr = { version = "0.17.0" }
multiaddr = { version = "0.17.1" }
2 changes: 1 addition & 1 deletion examples/file-sharing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ either = "1.8"
env_logger = "0.10"
futures = "0.3.27"
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "mplex", "noise", "macros", "request-response", "tcp", "websocket", "yamux"] }
multiaddr = { version = "0.17.0" }
multiaddr = { version = "0.17.1" }
2 changes: 1 addition & 1 deletion examples/ipfs-private/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ either = "1.8"
env_logger = "0.10"
futures = "0.3.27"
libp2p = { path = "../../libp2p", features = ["async-std", "gossipsub", "dns", "identify", "kad", "macros", "mplex", "noise", "ping", "pnet", "tcp", "websocket", "yamux"] }
multiaddr = { version = "0.17.0" }
multiaddr = { version = "0.17.1" }
2 changes: 1 addition & 1 deletion examples/ping-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ async-std = { version = "1.12", features = ["attributes"] }
async-trait = "0.1"
futures = "0.3.27"
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "macros", "mplex", "noise", "ping", "tcp", "websocket", "yamux"] }
multiaddr = { version = "0.17.0" }
multiaddr = { version = "0.17.1" }
2 changes: 1 addition & 1 deletion identity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ bs58 = { version = "0.4.0", optional = true }
ed25519-dalek = { version = "1.0.1", optional = true }
libsecp256k1 = { version = "0.7.0", optional = true }
log = "0.4"
multiaddr = { version = "0.17.0", optional = true }
multiaddr = { version = "0.17.1", optional = true }
multihash = { version = "0.17.0", default-features = false, features = ["std", "multihash-impl", "identity", "sha2"], optional = true }
p256 = { version = "0.12", default-features = false, features = ["ecdsa", "std"], optional = true }
prost = { version = "0.11", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion interop-tests/src/bin/ping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async fn main() -> Result<()> {
)
.map(|(peer_id, conn), _| (peer_id, StreamMuxerBox::new(conn)))
.boxed(),
format!("/ip4/{ip}/udp/0/webrtc"),
format!("/ip4/{ip}/udp/0/webrtc-direct"),
),
};

Expand Down
2 changes: 1 addition & 1 deletion transports/webrtc/examples/listen_ping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use void::Void;
async fn main() -> Result<()> {
let mut swarm = create_swarm()?;

swarm.listen_on("/ip4/127.0.0.1/udp/0/webrtc".parse()?)?;
swarm.listen_on("/ip4/127.0.0.1/udp/0/webrtc-direct".parse()?)?;

loop {
let event = swarm.next().await.unwrap();
Expand Down
16 changes: 8 additions & 8 deletions transports/webrtc/src/tokio/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ mod tests {

#[test]
fn parse_valid_address_with_certhash_and_p2p() {
let addr = "/ip4/127.0.0.1/udp/39901/webrtc/certhash/uEiDikp5KVUgkLta1EjUN-IKbHk-dUBg8VzKgf5nXxLK46w/p2p/12D3KooWNpDk9w6WrEEcdsEH1y47W71S36yFjw4sd3j7omzgCSMS"
let addr = "/ip4/127.0.0.1/udp/39901/webrtc-direct/certhash/uEiDikp5KVUgkLta1EjUN-IKbHk-dUBg8VzKgf5nXxLK46w/p2p/12D3KooWNpDk9w6WrEEcdsEH1y47W71S36yFjw4sd3j7omzgCSMS"
.parse()
.unwrap();

Expand All @@ -499,7 +499,7 @@ mod tests {

#[test]
fn peer_id_is_not_required() {
let addr = "/ip4/127.0.0.1/udp/39901/webrtc/certhash/uEiDikp5KVUgkLta1EjUN-IKbHk-dUBg8VzKgf5nXxLK46w"
let addr = "/ip4/127.0.0.1/udp/39901/webrtc-direct/certhash/uEiDikp5KVUgkLta1EjUN-IKbHk-dUBg8VzKgf5nXxLK46w"
.parse()
.unwrap();

Expand All @@ -518,7 +518,7 @@ mod tests {

#[test]
fn tcp_is_invalid_protocol() {
let addr = "/ip4/127.0.0.1/tcp/12345/webrtc/certhash/uEiDikp5KVUgkLta1EjUN-IKbHk-dUBg8VzKgf5nXxLK46w"
let addr = "/ip4/127.0.0.1/tcp/12345/webrtc-direct/certhash/uEiDikp5KVUgkLta1EjUN-IKbHk-dUBg8VzKgf5nXxLK46w"
.parse()
.unwrap();

Expand All @@ -529,7 +529,7 @@ mod tests {

#[test]
fn cannot_follow_other_protocols_after_certhash() {
let addr = "/ip4/127.0.0.1/udp/12345/webrtc/certhash/uEiDikp5KVUgkLta1EjUN-IKbHk-dUBg8VzKgf5nXxLK46w/tcp/12345"
let addr = "/ip4/127.0.0.1/udp/12345/webrtc-direct/certhash/uEiDikp5KVUgkLta1EjUN-IKbHk-dUBg8VzKgf5nXxLK46w/tcp/12345"
.parse()
.unwrap();

Expand All @@ -541,7 +541,7 @@ mod tests {
#[test]
fn parse_ipv6() {
let addr =
"/ip6/::1/udp/12345/webrtc/certhash/uEiDikp5KVUgkLta1EjUN-IKbHk-dUBg8VzKgf5nXxLK46w/p2p/12D3KooWNpDk9w6WrEEcdsEH1y47W71S36yFjw4sd3j7omzgCSMS"
"/ip6/::1/udp/12345/webrtc-direct/certhash/uEiDikp5KVUgkLta1EjUN-IKbHk-dUBg8VzKgf5nXxLK46w/p2p/12D3KooWNpDk9w6WrEEcdsEH1y47W71S36yFjw4sd3j7omzgCSMS"
.parse()
.unwrap();

Expand All @@ -560,7 +560,7 @@ mod tests {

#[test]
fn can_parse_valid_addr_without_certhash() {
let addr = "/ip6/::1/udp/12345/webrtc".parse().unwrap();
let addr = "/ip6/::1/udp/12345/webrtc-direct".parse().unwrap();

let maybe_parsed = parse_webrtc_listen_addr(&addr);

Expand All @@ -574,7 +574,7 @@ mod tests {
fn fails_to_parse_if_certhash_present_but_wrong_hash_function() {
// We only support SHA2-256 for now but this certhash has been encoded with SHA3-256.
let addr =
"/ip6/::1/udp/12345/webrtc/certhash/uFiCH_tkkzpAwkoIDbE4I7QtQksFMYs5nQ4MyYrkgCJYi4A"
"/ip6/::1/udp/12345/webrtc-direct/certhash/uFiCH_tkkzpAwkoIDbE4I7QtQksFMYs5nQ4MyYrkgCJYi4A"
.parse()
.unwrap();

Expand All @@ -597,7 +597,7 @@ mod tests {
// is temporarily empty.
for _ in 0..2 {
let listener = transport
.listen_on("/ip4/0.0.0.0/udp/0/webrtc".parse().unwrap())
.listen_on("/ip4/0.0.0.0/udp/0/webrtc-direct".parse().unwrap())
.unwrap();
match poll_fn(|cx| Pin::new(&mut transport).as_mut().poll(cx)).await {
TransportEvent::NewAddress {
Expand Down
7 changes: 4 additions & 3 deletions transports/webrtc/tests/smoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ async fn smoke() {
let (a_peer_id, mut a_transport) = create_transport();
let (b_peer_id, mut b_transport) = create_transport();

let addr = start_listening(&mut a_transport, "/ip4/127.0.0.1/udp/0/webrtc").await;
start_listening(&mut b_transport, "/ip4/127.0.0.1/udp/0/webrtc").await;
let addr = start_listening(&mut a_transport, "/ip4/127.0.0.1/udp/0/webrtc-direct").await;
start_listening(&mut b_transport, "/ip4/127.0.0.1/udp/0/webrtc-direct").await;
let ((a_connected, _, _), (b_connected, _)) =
connect(&mut a_transport, &mut b_transport, addr).await;

Expand Down Expand Up @@ -109,7 +109,8 @@ fn prop(number_listeners: NonZeroU8, number_streams: NonZeroU8) -> quickcheck::T

async move {
let (peer_id, mut listener) = create_transport();
let addr = start_listening(&mut listener, "/ip4/127.0.0.1/udp/0/webrtc").await;
let addr =
start_listening(&mut listener, "/ip4/127.0.0.1/udp/0/webrtc-direct").await;

listeners_tx.send((peer_id, addr)).await.unwrap();

Expand Down