From aca59d1b646ec32eaf9ee7984a7c151225d719d2 Mon Sep 17 00:00:00 2001 From: gaoshiyao Date: Thu, 24 Oct 2019 19:32:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=B7=AF=E7=94=B1=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/handler/proxyhandler.go | 2 -- src/main.go | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/handler/proxyhandler.go b/src/handler/proxyhandler.go index b029fd4..17714fe 100644 --- a/src/handler/proxyhandler.go +++ b/src/handler/proxyhandler.go @@ -2,7 +2,6 @@ package handler import ( "fmt" - "github.com/sirupsen/logrus" "net/http" "strings" @@ -30,7 +29,6 @@ func CreateProxyHandler() (*ProxyHandler, error) { var ch chan bool func (handler *ProxyHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { - logrus.Info("===>", req.URL) if err := count(); err != nil { fmt.Println(err.Error()) w.Write([]byte("缓存计数失败!")) diff --git a/src/main.go b/src/main.go index ea1f838..413158d 100644 --- a/src/main.go +++ b/src/main.go @@ -27,6 +27,7 @@ func main() { counthandler, _ := handler.CreateCountHandler() http.Handle(fmt.Sprintf("%s%s", *argPrefix, "/count"), counthandler) http.Handle(*argPrefix+"/", proxyhandler) + http.Handle(os.Getenv("PROXY_PATH")+"/", proxyhandler) logrus.Info("Listen Server on port :", *argPort) http.ListenAndServe(fmt.Sprintf(":%d", *argPort), nil) } -- 2.26.0