mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-16 17:51:10 +00:00
Put back support for WebSockets in the transport (#1486)
This commit is contained in:
@@ -12,7 +12,7 @@ bytes = "0.4"
|
||||
error-chain = { version = "0.12", default-features = false }
|
||||
fnv = "1.0"
|
||||
futures = "0.1"
|
||||
libp2p = { version = "0.2", default-features = false, features = ["secio-rsa", "secio-secp256k1"] }
|
||||
libp2p = { version = "0.2", default-features = false, features = ["secio-rsa", "secio-secp256k1", "libp2p-websocket"] }
|
||||
parking_lot = "0.7.1"
|
||||
log = "0.4"
|
||||
rand = "0.5.0"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use futures::prelude::*;
|
||||
use libp2p::{InboundUpgradeExt, OutboundUpgradeExt, PeerId, Transport, mplex, secio, yamux, tcp, dns};
|
||||
use libp2p::{InboundUpgradeExt, OutboundUpgradeExt, PeerId, Transport, mplex, secio, yamux, tcp, dns, websocket};
|
||||
use libp2p::core::{self, transport::boxed::Boxed, muxing::StreamMuxerBox};
|
||||
use std::{io, time::Duration, usize};
|
||||
|
||||
@@ -28,6 +28,7 @@ pub fn build_transport(
|
||||
mplex_config.max_buffer_len(usize::MAX);
|
||||
|
||||
let transport = tcp::TcpConfig::new();
|
||||
let transport = websocket::WsConfig::new(transport.clone()).or_transport(transport);
|
||||
let transport = dns::DnsConfig::new(transport);
|
||||
|
||||
// TODO: rework the transport creation (https://github.com/libp2p/rust-libp2p/issues/783)
|
||||
|
||||
Reference in New Issue
Block a user