Use tokio built in dns

pull/1/head
Danny Browning 5 years ago
parent 3821e0952a
commit 46ac847977
  1. 7
      Cargo.toml
  2. 2
      src/connect.rs
  3. 1
      src/lib.rs

@ -13,7 +13,7 @@ edition = "2018"
[features] [features]
default = ["connect", "tls"] default = ["connect", "tls"]
connect = ["tokio-dns-unofficial", "tokio-net", "stream"] connect = ["tokio-net", "stream"]
tls = ["tokio-tls", "native-tls", "stream", "tungstenite/tls"] tls = ["tokio-tls", "native-tls", "stream", "tungstenite/tls"]
stream = ["bytes"] stream = ["bytes"]
@ -37,11 +37,6 @@ version = "0.4.8"
optional = true optional = true
version = "0.2.0" version = "0.2.0"
[dependencies.tokio-dns-unofficial]
optional = true
#version = "0.4.0"
git = "https://github.com/sbstp/tokio-dns.git"
[dependencies.tokio-net] [dependencies.tokio-net]
optional = true optional = true
version = "0.2.0-alpha.6" version = "0.2.0-alpha.6"

@ -125,7 +125,7 @@ where
.port_or_known_default() .port_or_known_default()
.expect("Bug: port unknown"); .expect("Bug: port unknown");
let try_socket = tokio_dns::TcpStream::connect((domain.as_str(), port)).await; let try_socket = TcpStream::connect((domain.as_str(), port)).await;
let socket = try_socket.map_err(Error::Io)?; let socket = try_socket.map_err(Error::Io)?;
client_async_tls(request, socket).await client_async_tls(request, socket).await
} }

@ -355,6 +355,5 @@ mod tests {
is_unpin::<WebSocketStream<tokio::net::TcpStream>>(); is_unpin::<WebSocketStream<tokio::net::TcpStream>>();
is_unpin::<WebSocketStream<AutoStream<tokio::net::TcpStream>>>(); is_unpin::<WebSocketStream<AutoStream<tokio::net::TcpStream>>>();
is_unpin::<WebSocketStream<AutoStream<tokio_dns::TcpStream>>>();
} }
} }

Loading…
Cancel
Save