1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-04-12 06:58:15 +02:00
imgproxy/main.go
2017-09-15 13:29:55 +03:00

29 lines
515 B
Go

package main
import (
"log"
"net"
"net/http"
"time"
"golang.org/x/net/netutil"
)
func main() {
l, err := net.Listen("tcp", conf.Bind)
if err != nil {
log.Fatal(err)
}
s := &http.Server{
Handler: newHttpHandler(),
ReadTimeout: time.Duration(conf.ReadTimeout) * time.Second,
WriteTimeout: time.Duration(conf.WriteTimeout) * time.Second,
MaxHeaderBytes: 1 << 20,
}
log.Printf("Starting server at %s\n", conf.Bind)
log.Fatal(s.Serve(netutil.LimitListener(l, conf.MaxClients)))
}