rrda

REST API allowing to perform DNS queries over HTTP
Log | Files | Refs | README | LICENSE

commit 0b2391d3cf75523eec5b871dde624d7d6f540477
parent f7e58ece58adb794aa86199e145d67f82badaa8d
Author: Frederic Cambus <fred@statdns.com>
Date:   Mon, 21 Nov 2022 11:19:00 +0100

Remove support for running in FastCGI mode.

Diffstat:
Mrrda.go | 25++++---------------------
1 file changed, 4 insertions(+), 21 deletions(-)

diff --git a/rrda.go b/rrda.go @@ -24,7 +24,6 @@ import ( "io" "net" "net/http" - "net/http/fcgi" "os" "strings" "time" @@ -170,14 +169,11 @@ func ptr(w http.ResponseWriter, r *http.Request) { } func main() { - fastcgi := flag.Bool("fastcgi", false, "Enable FastCGI mode") host := flag.String("host", "127.0.0.1", "Set the server host") port := flag.String("port", "8080", "Set the server port") flag.IntVar(&timeout_ms, "timeout", 2000, "Set the query timeout in ms") version := flag.Bool("version", false, "Display version") - mode := "HTTP" - flag.Usage = func() { fmt.Println("\nUSAGE:") flag.PrintDefaults() @@ -189,29 +185,16 @@ func main() { os.Exit(0) } - if *fastcgi { - mode = "FastCGI" - } - address := *host + ":" + *port r := chi.NewRouter() r.Get("/{server}/x/{ip}", ptr) r.Get("/{server}/{domain}/{querytype}", query) - if *fastcgi { - listener, _ := net.Listen("tcp", address) - - if err := fcgi.Serve(listener, r); err != nil { - fmt.Println("\nERROR:", err) - os.Exit(1) - } - } else { - if err := http.ListenAndServe(address, r); err != nil { - fmt.Println("\nERROR:", err) - os.Exit(1) - } + if err := http.ListenAndServe(address, r); err != nil { + fmt.Println("\nERROR:", err) + os.Exit(1) } - fmt.Println("Listening on ("+mode+" mode):", address) + fmt.Println("Listening on:", address) }