We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.7.4
...
roundtripper does not support reusing tcp connection for subsequent requests
For each RoundTrip, a new connection opens and a handshake takes place, which greatly affects the speed of sending requests
package main import ( "context" "io" "log" "net/url" http "github.com/bogdanfinn/fhttp" client "github.com/bogdanfinn/tls-client" ) func main() { ctx, cancel := context.WithCancel(context.Background()) defer cancel() options := []client.HttpClientOption{ //client.WithForceHttp1(), client.WithRandomTLSExtensionOrder(), client.WithTransportOptions(&client.TransportOptions{ MaxConnsPerHost: 1, DisableCompression: true, }), } client, _ := client.NewHttpClient(client.NewNoopLogger(), options...) u, _ := url.ParseRequestURI("https://tls.peet.ws/api/tls") for i := 0; i < 3; i++ { request := &http.Request{ Method: "GET", URL: u, Header: http.Header{}, } request = request.WithContext(ctx) response, _ := client.Do(request) log.Print(response) body, _ := io.ReadAll(response.Body) log.Printf("%s", string(body)) } }
The text was updated successfully, but these errors were encountered:
https://stackoverflow.com/questions/33238518/what-could-happen-if-i-dont-close-response-body
Sorry, something went wrong.
No branches or pull requests
TLS client version
1.7.4
System information
...
Issue description
roundtripper does not support reusing tcp connection for subsequent requests
For each RoundTrip, a new connection opens and a handshake takes place, which greatly affects the speed of sending requests
Steps to reproduce / Code Sample
The text was updated successfully, but these errors were encountered: