-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Any way to force to use HTTP/1.1 protocol #936
Comments
Unfortunately there's currently no way to force k6 to use HTTP/1.1 if the remote server supports HTTP/2 and the connection is over HTTPS. I think that's mostly a consequence of the way the Go standard library's HTTP client operates - it also doesn't allow us to specify the HTTP version you want to use for a particular request. That said, I think we can potentially slightly ameliorate this in k6 by adding the option to disable HTTP/2 globally, or at maybe at a per-VU/per- |
Thanks for the answer. Disallowing http/2 usage globally should be good enough. Cannot think about situation when I would like to test both protocols in the same benchmark session. Just found in the go's doc:
Before talking about refactoring, will the k6 see honor the GO's env variables? May be it can be a quick win... |
A quick test with import http from "k6/http";
export default function () {
let resp = http.get("https://google.com/");
console.log(resp.proto);
} shows that we unfortunately don't honor those environment variables. I think the reason is that line I quoted above: https://github.com/loadimpact/k6/blob/0b1b25949256544226cbe3641ad8024c06ef3420/js/runner.go#L171 |
Understood. Tnx for help. Will try for to fork k6 and implement it for my usage... if it will look good will open PR. |
A proposal on how something like this (among other things) could be implemented in k6 in a backwards compatible and reasonably performant and user-friendly way: #1045 (comment) |
@spaiz Did you find any solution? I am also facing same error ERRO[0004] GoError: Get "https://": stream error: stream ID 1; HTTP_1_1_REQUIRED |
This is now supported since #2222, but is still not documented as can be seen in grafana/k6-docs#664 to use it you need to set the I will leave this open both for more visibility and because I kind of doubt we will keep this working with the New HTTP API so we will likely need a different way to fix that there. |
I DO have a workaround for this... It's not great... but it works. set-item env:HTTPS_PROXY localhost:8888 This will set it to proxy through the default proxy port for Fiddler Classic. If nothing else, you could use this to ty to confirm whether this is actually the problem you're seeing or not. Also, check out the documentation for any questions on this. This doesn't just pertain to Android, it's just some of the better documentation on using fiddler as a proxy, and figuring out desktop proxy is easy - just launch fiddler and make sure it's setup correctly - here's the documentation on the tougher case. https://docs.telerik.com/fiddler/configure-fiddler/tasks/configureforandroid |
Since this is now fixed by #2222, and we're unlikely to change how this works in the current HTTP API, I'll close this issue. We're currently working on the new HTTP API (initial design document), and this feature will be addressed differently there. It's planned as part of Phase 1 of the proposal. |
Just looked over the docs and didn't find any way to force the k6 not to switch to HTTP 2
I must do it cause we have a clients that won't use HTTP 2, so when I test I want to test the same protocol.
Tnx.
The text was updated successfully, but these errors were encountered: