func main() { flag.Parse() h := requestHandler if *compress { h = fasthttp.CompressHandler(h) } if err := fasthttp.ListenAndServe(*addr, h); err != nil { log.Fatalf("Error in ListenAndServe: %s", err) } }
func main() { flag.Parse() upstreamClient = &http.Client{Timeout: 15 * time.Second} h := requestHandler if *compress { h = fasthttp.CompressHandler(h) } if err := fasthttp.ListenAndServe(*listenAddrs, h); err != nil { log.Fatalf("Error in ListenAndServe: %s", err) } }