Skip to content

Commit 7f4b9df

Browse files
author
root
committed
remove proxy option
1 parent 98c5dab commit 7f4b9df

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ Options:
2323
--hc/hl/hw/hh N[,N]+ : Hide responses with the specified code, lines, words, or chars.
2424
--sc/sl/sw/sh N[,N]]+ : Show responses with the specified code, lines, words, or chars.
2525
-t N : Specify the number of concurrent connections (10 default).
26-
-p URL : Specify proxy URL.
2726
-b COOKIE : Specify cookie.
2827
-ua USERAGENT : Specify user agent.
2928
--password PASSWORD : Specify password for basic web auth.

libgrequest/helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func PrintHelp() {
131131
fmt.Println("--hc/hl/hw/hh N[,N]+ : Hide responses with the specified code, lines, words, or chars.")
132132
fmt.Println("--sc/sl/sw/sh N[,N]]+ : Show responses with the specified code, lines, words, or chars.")
133133
fmt.Println("-t N : Specify the number of concurrent connections (10 default).")
134-
fmt.Println("-p URL : Specify proxy URL.")
134+
// fmt.Println("-p URL : Specify proxy URL.") TODO: need better cmdline parse for two URLs
135135
fmt.Println("-b COOKIE : Specify cookie.")
136136
fmt.Println("-ua USERAGENT : Specify user agent.")
137137
fmt.Println("--password PASSWORD : Specify password for basic web auth.")

libgrequest/output.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ func PrintChars(s *State, r *Result) {
2424
if s.Filter.Contains(r.Chars) == s.Show {
2525
if s.NoColor {
2626
PrintNoColorFn(s, r)
27+
} else {
28+
PrintColorFn(s, r)
2729
}
28-
PrintColorFn(s, r)
30+
2931
}
3032
}
3133

@@ -34,8 +36,10 @@ func PrintWords(s *State, r *Result) {
3436
if s.Filter.Contains(r.Words) == s.Show {
3537
if s.NoColor {
3638
PrintNoColorFn(s, r)
39+
} else {
40+
PrintColorFn(s, r)
3741
}
38-
PrintColorFn(s, r)
42+
3943
}
4044
}
4145

@@ -44,8 +48,10 @@ func PrintStatus(s *State, r *Result) {
4448
if s.Filter.Contains(r.Code) == s.Show { // issue nil
4549
if s.NoColor {
4650
PrintNoColorFn(s, r)
51+
} else {
52+
PrintColorFn(s, r)
4753
}
48-
PrintColorFn(s, r)
54+
4955
}
5056
}
5157

@@ -54,8 +60,10 @@ func PrintLines(s *State, r *Result) {
5460
if s.Filter.Contains(r.Lines) == s.Show {
5561
if s.NoColor {
5662
PrintNoColorFn(s, r)
63+
} else {
64+
PrintColorFn(s, r)
5765
}
58-
PrintColorFn(s, r)
66+
5967
}
6068
}
6169

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ func ParseCmdLine(str string) *libgrequest.State {
1616
s.Counter = libgrequest.InitSafeCounter()
1717
s.Fuzzer = libgrequest.InitFuzz()
1818
s.FollowRedirect = !libgrequest.ArgBool(str, "--no-follow") // !lazydefault1: follow redirect
19-
s.URL = libgrequest.ArgString(str, " htt(p|ps).+")
19+
s.URL = libgrequest.ArgString(str, "htt(p|ps).+")
2020
s.InsecureSSL = !libgrequest.ArgBool(str, "-k") // !lazydefault2: skip verify
2121
threads := libgrequest.ArgInt(str, "-t.[0-9]*")
22-
proxy := libgrequest.ArgString(str, "-p.htt(p|ps)://(.)*")
22+
proxy := libgrequest.ArgString(str, "-p.htt(p|ps).+") // TODO
2323
s.Quiet = libgrequest.ArgBool(str, "-q")
2424
s.Cookies = libgrequest.ArgString(str, "-b.[a-zA-Z0-9=/?]*")
2525
s.Password = libgrequest.ArgString(str, "--password.[a-zA-Z0-9=/?]*")

0 commit comments

Comments
 (0)