diff --git a/adapter/outbound/hysteria.go b/adapter/outbound/hysteria.go index 9dc34b44..cd36db5a 100644 --- a/adapter/outbound/hysteria.go +++ b/adapter/outbound/hysteria.go @@ -334,7 +334,7 @@ type hyDialerWithContext struct { func (h *hyDialerWithContext) ListenPacket(rAddr net.Addr) (net.PacketConn, error) { network := "udp" if addrPort, err := netip.ParseAddrPort(rAddr.String()); err == nil { - if addrPort.Addr().Is6() { + if addrPort.Addr().Unmap().Is6() { network = "udp6" } } diff --git a/adapter/outbound/tuic.go b/adapter/outbound/tuic.go index 8df1539a..5119f8d2 100644 --- a/adapter/outbound/tuic.go +++ b/adapter/outbound/tuic.go @@ -80,7 +80,7 @@ func (t *Tuic) dial(ctx context.Context, opts ...dialer.Option) (pc net.PacketCo } addr = udpAddr network := "udp" - if udpAddr.AddrPort().Addr().Is6() { + if udpAddr.AddrPort().Addr().Unmap().Is6() { network = "udp6" } pc, err = dialer.ListenPacket(ctx, network, "", opts...)