Async copy.

To improve performance, this results in better consistent average latency but lower throughput in some cases.
This commit is contained in:
FireMasterK 2021-04-09 14:19:38 +05:30
parent 17bc0c3321
commit 916df915b3
No known key found for this signature in database
GPG Key ID: 8DFF5DD33E93DB58
1 changed files with 1 additions and 1 deletions

View File

@ -101,7 +101,7 @@ func (*requesthandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
w.WriteHeader(resp.StatusCode)
io.Copy(w, resp.Body)
go io.Copy(w, resp.Body)
}
func copyHeaders(from http.Header, to http.Header) {