Skip to content

Commit

Permalink
Add licence
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-jiajia committed May 21, 2023
1 parent f421a05 commit eb3cca1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## EasyStress

Send a lot of requests to test a website's stress resistance
Send a lot of requests to test a website's stress resistance

**This program is just made for test stress resistance of websites, not for DDOS attack.**

> To use this program, you must agree these terms:
- All the Consequences made by using this program should be borne by you, not by me (the author of this program).

- You use this program means you agree to all the terms.

- If you don't agree to these terms, you MUST stop using this program AT ONCE.
29 changes: 23 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,22 @@ func print_im() {
}
}
func main() {
var c int
app := &cli.App{
Name: "EasyStress",
Usage: "Send a lot of requests to test a website's stress resistance",
Version: "v1.0.0",
Version: "v1.1",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "licence",
Usage: "Show the licence",
Aliases: []string{"l"},
Count: &c,
},
&cli.IntFlag{
Name: "time",
Usage: "The time of sending requests",
Aliases: []string{"t"},
Required: true,
Name: "time",
Usage: "The time of sending requests",
Aliases: []string{"t"},
},
&cli.IntFlag{
Name: "worker",
Expand All @@ -97,9 +103,21 @@ func main() {
},
},
Action: func(ctx *cli.Context) error {
if c != 0 {
fmt.Print(`You should have known that this program is just made for test stress resistance of websites, not for DDOS attack.
To use this program, you must agree these terms:
- All the Consequences made by using this program should be borne by you, not by me (the author of this program).
- You use this program means you agree to all the terms.
- If you don't agree to these terms, you MUST stop using this program AT ONCE.`)
return cli.Exit("", 0)
}
if ctx.NArg() != 1 {
return cli.Exit("Only 1 argument(website) is allowed!", -1)
}
time_amount = ctx.Int("time")
if time_amount == 0 {
return cli.Exit("Required flag \"t\" not set", -1)
}
use_file = ctx.String("file") != ""
if use_file {
file_name = ctx.String("file")
Expand Down Expand Up @@ -127,7 +145,6 @@ func main() {
}
website = ctx.Args().Get(0)
worker_amount := ctx.Int("worker")
time_amount = ctx.Int("time")
if worker_amount > time_amount {
fmt.Println("\033[33mWarning:\033[0m workers more than requests")
}
Expand Down

0 comments on commit eb3cca1

Please sign in to comment.