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{
|
||||
Methods: "GET",
|
||||
Threads: 2,
|
||||
InputTargetHost: goflags.StringSlice{"scanme.sh", "projectdiscovery.io", "localhost"},
|
||||
//InputFile: "./targetDomains.txt", // path to file containing the target domains list
|
||||
OnResult: func(r runner.Result) {
|
||||
|
@ -34,6 +34,7 @@ import (
|
||||
|
||||
const (
|
||||
two = 2
|
||||
defaultThreads = 50
|
||||
DefaultResumeFile = "resume.cfg"
|
||||
DefaultOutputDirectory = "output"
|
||||
)
|
||||
@ -386,7 +387,7 @@ func ParseOptions() *Options {
|
||||
)
|
||||
|
||||
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.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)
|
||||
}
|
||||
|
||||
if options.Threads == 0 {
|
||||
gologger.Info().Msgf("Threads automatically set to %d", defaultThreads)
|
||||
options.Threads = defaultThreads
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user