mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-28 09:11:34 +00:00
*: Enable libp2p to run via wasm32-unknown-unknown in the browser (#2320)
Changes needed to get libp2p to run via `wasm32-unknown-unknown` in the browser (both main thread and inside web workers). Replaces wasm-timer with futures-timer and instant. Co-authored-by: Oliver Wangler <oliver@wngr.de>
This commit is contained in:
@ -32,13 +32,13 @@ use asynchronous_codec::Framed;
|
||||
use bytes::BytesMut;
|
||||
use codec::UviBytes;
|
||||
use futures::prelude::*;
|
||||
use instant::Instant;
|
||||
use libp2p_core::upgrade::{InboundUpgrade, OutboundUpgrade, UpgradeInfo};
|
||||
use libp2p_core::{Multiaddr, PeerId};
|
||||
use prost::Message;
|
||||
use std::{borrow::Cow, convert::TryFrom, time::Duration};
|
||||
use std::{io, iter};
|
||||
use unsigned_varint::codec;
|
||||
use wasm_timer::Instant;
|
||||
|
||||
/// The protocol name used for negotiating with multistream-select.
|
||||
pub const DEFAULT_PROTO_NAME: &[u8] = b"/ipfs/kad/1.0.0";
|
||||
|
Reference in New Issue
Block a user