package main

import (
	"net/http"
	"time"
)

func main() {
	mock()
	// attack()
}

func mock() {

	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		// waiting := rand.Intn(450) + 50
		// time.Sleep(time.Duration(waiting) * time.Millisecond)
		time.Sleep(200 * time.Millisecond)
		_, _ = w.Write([]byte("Hello World"))
	})

	serv := &http.Server{
		Addr:    ":8080",
		Handler: nil,
	}
	serv.SetKeepAlivesEnabled(false)
	err := serv.ListenAndServe()
	if err != nil {
		panic(err)
	}
}
