mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 02:09:06 +00:00
v6 hole punch (#873)
Some devices have ipv6 but don't allow input connection, this patch add hole punching for these devices. - **add v6 hole punch msg to udp tunnel** - **send hole punch packet when do ipv6 direct connect**
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
use std::{error::Error, net::SocketAddr, sync::Arc};
|
||||
|
||||
use crate::tunnel::{
|
||||
check_scheme_and_get_socket_addr_ext,
|
||||
common::{FramedReader, FramedWriter, TunnelWrapper},
|
||||
TunnelInfo,
|
||||
};
|
||||
@@ -151,7 +150,7 @@ impl QUICTunnelConnector {
|
||||
impl TunnelConnector for QUICTunnelConnector {
|
||||
async fn connect(&mut self) -> Result<Box<dyn Tunnel>, super::TunnelError> {
|
||||
let addr =
|
||||
check_scheme_and_get_socket_addr_ext::<SocketAddr>(&self.addr, "quic", self.ip_version)
|
||||
check_scheme_and_get_socket_addr::<SocketAddr>(&self.addr, "quic", self.ip_version)
|
||||
.await?;
|
||||
let local_addr = if addr.is_ipv4() {
|
||||
"0.0.0.0:0"
|
||||
|
||||
Reference in New Issue
Block a user