Fix SOCKS outbound

This commit is contained in:
世界 2023-09-12 13:25:50 +08:00
parent efe33cf48d
commit be61ca64d4
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4

View File

@ -113,9 +113,17 @@ func (h *Socks) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.
}
func (h *Socks) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error {
return NewDirectConnection(ctx, h.router, h, conn, metadata)
if h.resolve {
return NewDirectConnection(ctx, h.router, h, conn, metadata)
} else {
return NewConnection(ctx, h, conn, metadata)
}
}
func (h *Socks) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error {
return NewDirectPacketConnection(ctx, h.router, h, conn, metadata)
if h.resolve {
return NewDirectPacketConnection(ctx, h.router, h, conn, metadata)
} else {
return NewPacketConnection(ctx, h, conn, metadata)
}
}