add socks5 udp relay

This commit is contained in:
ginuerzh
2021-11-08 15:26:23 +08:00
parent 16f34d3e94
commit 10f53e18a0
12 changed files with 459 additions and 43 deletions

View File

@ -87,6 +87,7 @@ func (h *socks5Handler) muxBindLocal(ctx context.Context, conn net.Conn, addr st
// Issue: may not reachable when host has multi-interface
socksAddr.Host, _, _ = net.SplitHostPort(conn.LocalAddr().String())
socksAddr.Type = 0
reply := gosocks5.NewReply(gosocks5.Succeeded, socksAddr)
if err := reply.Write(conn); err != nil {
h.logger.Error(err)