no cert, resolve addrs
This commit is contained in:
@@ -4,7 +4,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
use quinn::{ClientConfig, Connection, Endpoint, crypto::rustls::QuicClientConfig};
|
use quinn::{ClientConfig, Connection, Endpoint, crypto::rustls::QuicClientConfig};
|
||||||
use std::{
|
use std::{
|
||||||
net::{Ipv6Addr, SocketAddr, SocketAddrV6},
|
net::{Ipv6Addr, SocketAddr, SocketAddrV6, ToSocketAddrs},
|
||||||
str::FromStr,
|
str::FromStr,
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
};
|
};
|
||||||
@@ -74,7 +74,8 @@ async fn connect_the(handle: AppHandle, ip: String) -> anyhow::Result<()> {
|
|||||||
let (client_send, mut client_recv) = tokio::sync::mpsc::unbounded_channel::<NetCmd>();
|
let (client_send, mut client_recv) = tokio::sync::mpsc::unbounded_channel::<NetCmd>();
|
||||||
|
|
||||||
handle.send(ClientEvent::Connect(client_send));
|
handle.send(ClientEvent::Connect(client_send));
|
||||||
let addr = SocketAddr::from_str(&ip).unwrap();
|
let addr = ip.to_socket_addrs().unwrap().next().unwrap();
|
||||||
|
// let addr = SocketAddr::from_str(&ip).unwrap();
|
||||||
let conn = connection_no_cert(addr).await?;
|
let conn = connection_no_cert(addr).await?;
|
||||||
|
|
||||||
while let Some(msg) = client_recv.recv().await {
|
while let Some(msg) = client_recv.recv().await {
|
||||||
|
|||||||
Reference in New Issue
Block a user