Skip to content
New issue

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

How can I enable HTTP/2? #90

Open
TangGV opened this issue Dec 18, 2023 · 2 comments
Open

How can I enable HTTP/2? #90

TangGV opened this issue Dec 18, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@TangGV
Copy link

TangGV commented Dec 18, 2023

TLS client version

v1.7.0

System information

..

Issue description

client, _ := tls_client.NewHttpClient(tls_client.NewNoopLogger(), []tls_client.HttpClientOption{
	tls_client.WithCookieJar(tls_client.NewCookieJar()),
	tls_client.WithClientProfile(profiles.Safari_IOS_16_0),
	tls_client.WithTimeoutSeconds(500),
}...)

Steps to reproduce / Code Sample

client, _ := tls_client.NewHttpClient(tls_client.NewNoopLogger(), []tls_client.HttpClientOption{
	tls_client.WithCookieJar(tls_client.NewCookieJar()),
	tls_client.WithClientProfile(profiles.Safari_IOS_16_0),
	tls_client.WithTimeoutSeconds(500),
}...)
@TangGV TangGV added the bug Something isn't working label Dec 18, 2023
@TangGV
Copy link
Author

TangGV commented Dec 18, 2023

req, err := http.NewRequest(c.Request.Method, requestURL, bytes.NewReader(requestBody))

client, _ := tls_client.NewHttpClient(tls_client.NewNoopLogger(), []tls_client.HttpClientOption{
tls_client.WithCookieJar(tls_client.NewCookieJar()),
tls_client.WithClientProfile(profiles.Safari_IOS_16_0),
tls_client.WithTimeoutSeconds(500),
}...)

client.Do(req)

@bogdanfinn
Copy link
Owner

HTTP1/2 will be selected when the connection is created. It depends on your selected tls profile and of course the server. If both negotiate on http2 (and of course support it) it will be automatically used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants