add udp relay support for http handler

This commit is contained in:
ginuerzh
2021-12-01 21:23:19 +08:00
parent f3411832a8
commit 15f9aa091b
13 changed files with 386 additions and 250 deletions

View File

@ -167,11 +167,5 @@ func (c *socks5Connector) connectUDP(ctx context.Context, conn net.Conn, network
return nil, errors.New("get socks5 UDP tunnel failure")
}
baddr, err := net.ResolveUDPAddr("udp", reply.Addr.String())
if err != nil {
return nil, err
}
c.logger.Debugf("associate on %s OK", baddr)
return socks.UDPTunClientConn(conn, addr), nil
}