From 2d224c0d67f4e2b8430c92d79a08c24495a2241f Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Fri, 22 Sep 2023 11:35:40 +0800 Subject: [PATCH] nacos config --- proxyserver/main.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/proxyserver/main.go b/proxyserver/main.go index a4a2da96..745eb268 100644 --- a/proxyserver/main.go +++ b/proxyserver/main.go @@ -18,7 +18,6 @@ import ( "time" "github.com/gorilla/websocket" - "github.com/zeromicro/go-zero/core/logx" "gopkg.in/yaml.v2" _ "fusenapi/utils/auth" @@ -105,16 +104,16 @@ func main() { // 对/api开头的请求进行反向代理 proxy := httputil.NewSingleHostReverseProxy(apiURL) - proxy.ErrorHandler = func(res http.ResponseWriter, req *http.Request, err error) { - if err != nil { + // proxy.ErrorHandler = func(res http.ResponseWriter, req *http.Request, err error) { + // if err != nil { - // 在发生错误时进行处理 - log.Println(res.Header()) - logx.Info(err) - logx.Info(res.Header()) - res.WriteHeader(http.StatusNotFound) // 返回404状态码 - } - } + // // 在发生错误时进行处理 + // log.Println(res.Header()) + // logx.Info(err) + // logx.Info(res.Header()) + // res.WriteHeader(http.StatusNotFound) // 返回404状态码 + // } + // } proxy.ServeHTTP(w, r) return