From c7c80cf90ec8630e64b1d8a09b1c104541b2dcfc Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Mon, 29 Aug 2022 12:10:46 +0800 Subject: [PATCH] fix: hysteria udp crash --- adapter/outbound/hysteria.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adapter/outbound/hysteria.go b/adapter/outbound/hysteria.go index adc904a2..9446cf93 100644 --- a/adapter/outbound/hysteria.go +++ b/adapter/outbound/hysteria.go @@ -72,6 +72,9 @@ func (h *Hysteria) ListenPacketContext(ctx context.Context, metadata *C.Metadata hyDialer: func() (net.PacketConn, error) { return dialer.ListenPacket(ctx, "udp", "", h.Base.DialOptions(opts...)...) }, + remoteAddr: func(addr string) (net.Addr, error) { + return resolveUDPAddrWithPrefer("udp", addr, h.prefer) + }, } udpConn, err := h.client.DialUDP(&hdc) if err != nil {