Skip to content

Commit

Permalink
Fix SOCKS outbound
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Sep 12, 2023
1 parent efe33cf commit be61ca6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions outbound/socks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit be61ca6

Please sign in to comment.