throttle https
parent
567379a6f1
commit
3092e9f62f
|
|
@ -69,7 +69,14 @@ func (s *Server) Connect(w http.ResponseWriter, r *http.Request) {
|
|||
xfer := func(dst io.WriteCloser, src io.ReadCloser) {
|
||||
defer dst.Close()
|
||||
defer src.Close()
|
||||
io.Copy(dst, src)
|
||||
io.Copy(
|
||||
throttledWriter{
|
||||
ctx: r.Context(),
|
||||
w: dst,
|
||||
limiter: s.limiter,
|
||||
},
|
||||
src,
|
||||
)
|
||||
}
|
||||
|
||||
go xfer(dest, client)
|
||||
|
|
|
|||
Loading…
Reference in New Issue