Skip to content

Commit

Permalink
Merge pull request #2 from vitalyliber/error_while_testing_url_with_ssl
Browse files Browse the repository at this point in the history
Error while testing url with ssl
  • Loading branch information
vitalyliber authored Dec 8, 2018
2 parents a5e1c17 + ebc8b50 commit 67ebb18
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@ Minimalistic performance and load testing tool written in Go.

## How to use gostorm?

- Build or download version for your OS
- Download and install to MacOS

```
curl -L https://github.com/vitalyliber/gostorm/releases/download/v.1.0.1/gostorm_macos -o /usr/local/bin/gostorm
sudo chmod a+x /usr/local/bin/gostorm
```

- Download and install to Linux


```
curl -L https://github.com/vitalyliber/gostorm/releases/download/v.1.0.1/gostorm_linux -o /usr/local/bin/gostorm
sudo chmod a+x /usr/local/bin/gostorm
```

- Run and paste url:
```bash
Expand Down Expand Up @@ -36,4 +49,4 @@ Windows

```bash
GOOS=windows GOARCH=amd64 go build -o gostorm_windows
```
```
18 changes: 13 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,24 @@ func main() {

func storm(url string) {
for {
log.Println("Start attack to url:", url)
log.Println("Start load test on the url:", url)
resp, err := http.Get(url)
if err != nil {
log.Println("Got error code from site:", resp.Status)
log.Println("Got error code from url:", resp.Status)
return
} else {
log.Println("Success attack:", resp.Status)
log.Println("Load test passed successfuly:", resp.Status)
}
defer resp.Body.Close()

defer func() {
err := resp.Body.Close()
if err != nil {
log.Println("Error while closing connection", err)
}
return
}()

counter += 1
log.Println("Number of attack:", counter)
log.Println("Number of successful test:", counter)
}
}

0 comments on commit 67ebb18

Please sign in to comment.