Skip to content

Commit

Permalink
Merge pull request #139 from projectdiscovery/feat-ctx-ip-arg
Browse files Browse the repository at this point in the history
Adding ip context arg type
  • Loading branch information
Mzack9999 committed Jun 22, 2023
2 parents 9af36f0 + 5cc8977 commit 937580e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions fastdialer/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ type ContextOption string
const (
// SniName to use in tls connection
SniName ContextOption = "sni-name"
IP ContextOption = "ip"
)
2 changes: 1 addition & 1 deletion fastdialer/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (d *Dialer) dial(ctx context.Context, network, address string, shouldUseTLS
fixedIP = addressParts[2]
}
// check if the ip is within the context
if ctxIP := ctx.Value("ip"); ctxIP != nil {
if ctxIP := ctx.Value(IP); ctxIP != nil {
fixedIP = fmt.Sprint(ctxIP)
}
} else {
Expand Down

0 comments on commit 937580e

Please sign in to comment.