Skip to content

Commit

Permalink
remove proxy option
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Feb 14, 2019
1 parent 98c5dab commit 7f4b9df
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Options:
--hc/hl/hw/hh N[,N]+ : Hide responses with the specified code, lines, words, or chars.
--sc/sl/sw/sh N[,N]]+ : Show responses with the specified code, lines, words, or chars.
-t N : Specify the number of concurrent connections (10 default).
-p URL : Specify proxy URL.
-b COOKIE : Specify cookie.
-ua USERAGENT : Specify user agent.
--password PASSWORD : Specify password for basic web auth.
Expand Down
2 changes: 1 addition & 1 deletion libgrequest/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func PrintHelp() {
fmt.Println("--hc/hl/hw/hh N[,N]+ : Hide responses with the specified code, lines, words, or chars.")
fmt.Println("--sc/sl/sw/sh N[,N]]+ : Show responses with the specified code, lines, words, or chars.")
fmt.Println("-t N : Specify the number of concurrent connections (10 default).")
fmt.Println("-p URL : Specify proxy URL.")
// fmt.Println("-p URL : Specify proxy URL.") TODO: need better cmdline parse for two URLs
fmt.Println("-b COOKIE : Specify cookie.")
fmt.Println("-ua USERAGENT : Specify user agent.")
fmt.Println("--password PASSWORD : Specify password for basic web auth.")
Expand Down
16 changes: 12 additions & 4 deletions libgrequest/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ func PrintChars(s *State, r *Result) {
if s.Filter.Contains(r.Chars) == s.Show {
if s.NoColor {
PrintNoColorFn(s, r)
} else {
PrintColorFn(s, r)
}
PrintColorFn(s, r)

}
}

Expand All @@ -34,8 +36,10 @@ func PrintWords(s *State, r *Result) {
if s.Filter.Contains(r.Words) == s.Show {
if s.NoColor {
PrintNoColorFn(s, r)
} else {
PrintColorFn(s, r)
}
PrintColorFn(s, r)

}
}

Expand All @@ -44,8 +48,10 @@ func PrintStatus(s *State, r *Result) {
if s.Filter.Contains(r.Code) == s.Show { // issue nil
if s.NoColor {
PrintNoColorFn(s, r)
} else {
PrintColorFn(s, r)
}
PrintColorFn(s, r)

}
}

Expand All @@ -54,8 +60,10 @@ func PrintLines(s *State, r *Result) {
if s.Filter.Contains(r.Lines) == s.Show {
if s.NoColor {
PrintNoColorFn(s, r)
} else {
PrintColorFn(s, r)
}
PrintColorFn(s, r)

}
}

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ func ParseCmdLine(str string) *libgrequest.State {
s.Counter = libgrequest.InitSafeCounter()
s.Fuzzer = libgrequest.InitFuzz()
s.FollowRedirect = !libgrequest.ArgBool(str, "--no-follow") // !lazydefault1: follow redirect
s.URL = libgrequest.ArgString(str, " htt(p|ps).+")
s.URL = libgrequest.ArgString(str, "htt(p|ps).+")
s.InsecureSSL = !libgrequest.ArgBool(str, "-k") // !lazydefault2: skip verify
threads := libgrequest.ArgInt(str, "-t.[0-9]*")
proxy := libgrequest.ArgString(str, "-p.htt(p|ps)://(.)*")
proxy := libgrequest.ArgString(str, "-p.htt(p|ps).+") // TODO
s.Quiet = libgrequest.ArgBool(str, "-q")
s.Cookies = libgrequest.ArgString(str, "-b.[a-zA-Z0-9=/?]*")
s.Password = libgrequest.ArgString(str, "--password.[a-zA-Z0-9=/?]*")
Expand Down

0 comments on commit 7f4b9df

Please sign in to comment.