Skip to content

Commit

Permalink
update handle associate
Browse files Browse the repository at this point in the history
  • Loading branch information
uoosef committed Aug 6, 2023
1 parent c05d344 commit 03046ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bepass-cli/socks5/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,17 @@ func (sf *Server) handleAssociate(ctx context.Context, writer io.Writer, request
if dest.FQDN != "" {
ctx, dest.IP, err = sf.resolver.Resolve(ctx, dest.FQDN)
if err != nil {
if err := SendReply(write, statute.RepHostUnreachable, nil); err != nil {
if err := SendReply(writer, statute.RepHostUnreachable, nil); err != nil {
return fmt.Errorf("failed to send reply, %v", err)
}
return fmt.Errorf("failed to resolve destination[%v], %v", dest.FQDN, err)
}
}

// Apply any address rewrites
req.DestAddr = req.RawDestAddr
request.DestAddr = request.RawDestAddr
if sf.rewriter != nil {
ctx, req.DestAddr = sf.rewriter.Rewrite(ctx, req)
ctx, request.DestAddr = sf.rewriter.Rewrite(ctx, request)
}
// Attempt to connect
dial := sf.dial
Expand Down

0 comments on commit 03046ec

Please sign in to comment.