Skip to content

Commit

Permalink
fix: sidecar proxy http request report "use of closed network connect…
Browse files Browse the repository at this point in the history
…ion"
  • Loading branch information
RayHuangCN committed May 18, 2021
1 parent de65c92 commit 035a49b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module tkestack.io/kvass
go 1.15

require (
github.com/cssivision/reverseproxy v0.0.1
github.com/gin-contrib/pprof v1.3.0
github.com/gin-gonic/gin v1.6.3
github.com/go-kit/kit v0.10.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/cssivision/reverseproxy v0.0.1 h1:IvhNE3XITZOWFhON2faKbrDeGpqa+yfessLQKSSt15U=
github.com/cssivision/reverseproxy v0.0.1/go.mod h1:+QTeWrlVNQDAiB3pnaecTCk5rh1sS3cJltUl/+L2APg=
github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand Down
4 changes: 2 additions & 2 deletions pkg/sidecar/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
package sidecar

import (
"github.com/cssivision/reverseproxy"
"github.com/gin-contrib/pprof"
"github.com/gin-gonic/gin"
"github.com/sirupsen/logrus"
"net/http"
"net/http/httputil"
"net/url"
"tkestack.io/kvass/pkg/api"
"tkestack.io/kvass/pkg/prom"
Expand Down Expand Up @@ -88,7 +88,7 @@ func (s *Service) ServeHTTP(wt http.ResponseWriter, r *http.Request) {
}

u, _ := url.Parse(s.promURL)
httputil.NewSingleHostReverseProxy(u).ServeHTTP(wt, r)
reverseproxy.NewReverseProxy(u).ServeHTTP(wt, r)
}

// Run start Service at "address"
Expand Down

0 comments on commit 035a49b

Please sign in to comment.