mirror of
https://github.com/projectdiscovery/httpx.git
synced 2024-08-17 05:20:29 +03:00
commit to last commit
This commit is contained in:
parent
d77348b8da
commit
dece6fce63
@ -15,7 +15,6 @@ func main() {
|
|||||||
|
|
||||||
options := runner.Options{
|
options := runner.Options{
|
||||||
Methods: "GET",
|
Methods: "GET",
|
||||||
Threads: 2,
|
|
||||||
InputTargetHost: goflags.StringSlice{"scanme.sh", "projectdiscovery.io", "localhost"},
|
InputTargetHost: goflags.StringSlice{"scanme.sh", "projectdiscovery.io", "localhost"},
|
||||||
//InputFile: "./targetDomains.txt", // path to file containing the target domains list
|
//InputFile: "./targetDomains.txt", // path to file containing the target domains list
|
||||||
OnResult: func(r runner.Result) {
|
OnResult: func(r runner.Result) {
|
||||||
|
@ -34,6 +34,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
two = 2
|
two = 2
|
||||||
|
defaultThreads = 50
|
||||||
DefaultResumeFile = "resume.cfg"
|
DefaultResumeFile = "resume.cfg"
|
||||||
DefaultOutputDirectory = "output"
|
DefaultOutputDirectory = "output"
|
||||||
)
|
)
|
||||||
@ -386,7 +387,7 @@ func ParseOptions() *Options {
|
|||||||
)
|
)
|
||||||
|
|
||||||
flagSet.CreateGroup("rate-limit", "Rate-Limit",
|
flagSet.CreateGroup("rate-limit", "Rate-Limit",
|
||||||
flagSet.IntVarP(&options.Threads, "threads", "t", 50, "number of threads to use"),
|
flagSet.IntVarP(&options.Threads, "threads", "t", defaultThreads, "number of threads to use"),
|
||||||
flagSet.IntVarP(&options.RateLimit, "rate-limit", "rl", 150, "maximum requests to send per second"),
|
flagSet.IntVarP(&options.RateLimit, "rate-limit", "rl", 150, "maximum requests to send per second"),
|
||||||
flagSet.IntVarP(&options.RateLimitMinute, "rate-limit-minute", "rlm", 0, "maximum number of requests to send per minute"),
|
flagSet.IntVarP(&options.RateLimitMinute, "rate-limit-minute", "rlm", 0, "maximum number of requests to send per minute"),
|
||||||
)
|
)
|
||||||
@ -680,6 +681,11 @@ func (options *Options) ValidateOptions() error {
|
|||||||
return fmt.Errorf("invalid protocol: %s", options.Protocol)
|
return fmt.Errorf("invalid protocol: %s", options.Protocol)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if options.Threads == 0 {
|
||||||
|
gologger.Info().Msgf("Threads automatically set to %d", defaultThreads)
|
||||||
|
options.Threads = defaultThreads
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user