From 60d1646b07955f6b29a9fcc94300a036cffe42f4 Mon Sep 17 00:00:00 2001 From: gaoshiyao Date: Mon, 10 Aug 2020 00:46:00 +0800 Subject: [PATCH] tls --- src/handler/proxyhandler.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/handler/proxyhandler.go b/src/handler/proxyhandler.go index aa07b99..4616dc6 100644 --- a/src/handler/proxyhandler.go +++ b/src/handler/proxyhandler.go @@ -46,7 +46,9 @@ func Proxy(c *gin.Context) { c.JSON(200, res) return } - f, _ := forward.New(forward.PassHostHeader(true), forward.WebsocketTLSClientConfig(&tls.Config{InsecureSkipVerify: true}), forward.ResponseModifier(func(resp *http.Response) error { + roundTripper := http.DefaultTransport.(*http.Transport) + roundTripper.TLSClientConfig = &tls.Config{InsecureSkipVerify: true} + f, _ := forward.New(forward.PassHostHeader(true), forward.RoundTripper(roundTripper), forward.ResponseModifier(func(resp *http.Response) error { //Resp = resp //判断是否超过调用次数是否可以调用 callflag, sensitiveflag, err := service.QueryCallsCount(proxyData) -- 2.26.0