diff --git a/cmd/yggstack/main.go b/cmd/yggstack/main.go index 47e04be..35912c5 100644 --- a/cmd/yggstack/main.go +++ b/cmd/yggstack/main.go @@ -374,12 +374,12 @@ func main() { connVal, ok := remoteUdpConnections.Load(remoteUdpAddr) if !ok { - udpFwdConn, err = net.DialUDP("udp", nil, mapping.Mapped) + *udpFwdConn, err = net.DialUDP("udp", nil, mapping.Mapped) if err != nil { logger.Errorf("Failed to connect to %s: %s", mapping.Mapped, err) continue } - remoteUdpConnections.Store(remoteUdpAddr, &udpFwdConn) + remoteUdpConnections.Store(remoteUdpAddr, udpFwdConn) go types.ReverseProxyUDP(mtu, udpListenConn, remoteUdpAddr, udpFwdConn) } else { udpFwdConn = connVal.(*net.UDPConn)