unix: support udp forwarding (#194)

This commit is contained in:
nadoo committed 2020-12-01 20:04:47 +08:00
1 parent 63112a1509
commit 142865535e
10 files changed
+259 -111

No files matched your search

+3 -1
View File
@@ -77,7 +77,9 @@ func (s *UDP) ListenAndServe() {
v, ok := nm.Load(lraddr.String())
if !ok && v == nil {
pc, dialer, raddr, err = s.proxy.DialUDP("udp", "")
// we know we are creating an udp tunnel, so the dial addr is meaningless,
// we use lraddr here to help the unix client to identify the source socket.
pc, dialer, raddr, err = s.proxy.DialUDP("udp", lraddr.String())
if err != nil {
log.F("[udp] remote dial error: %v", err)
continue