-
Notifications
You must be signed in to change notification settings - Fork 674
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
testcafe failing to connect when using --proxy option #6363
Comments
I even tried to use the option --proxy-bypass with that initial request to a local IP address, but didn't work either. |
Got the same issue from my end - had to downgrade to testcafe: 1.14.0 until this is fixed. |
I can confirm since version 1.14.1 (O.S independent): Cli options: Config file options (.testcaferc.json): in both cases proxy setup variables are ignored. |
@s0leris Interestingly, I downgraded and it worked for me just in Firefox, keeps failing in chromium. |
@ejosafat: on my hands I can confirm that v. 1.14.0 is working well on:
|
it's that installed in your host? I'm using Chromium from the official docker image (1.14.0), maybe there is some problem with the chromium version installed there. |
Hi folks,
...
this.configuration.mergeOptions(options);
console.dir(this.configuration);
... After that, please run your tests and share the console output. |
@miherlosev, this is the output:
|
So I tested using the latest version, 1.15.0, within the latest testcafe docker image. Firefox seems to be working now, even without the
|
Folks, We've tested the Please update to the latest TestCafe version ( |
I used the same command line to run 1.15.0, just replacing the browser used, in Firefox worked, in Chromium not, I would say that if the flags or the proxy server configuration were wrong, it wouldn't have worked in Firefox. Unfortunately, for security reasons, I can't share an example that runs against our proxy. However, I do appreciate you looking into this matter and the quick response. Thanks so much! |
@miherlosev: first of all, thank you so much for your support. I tried to use v 1.15.0 following your instructions this morning, but unfortunately it doesn't work on my environment, where with 1.14.0 running perfectly. My question is where I can find the parser of variables, because it looks weird that just changing my package.json file replacing testcafe version from 1.14.0 to 1.14.1 (until version 1.15.0) I got different behaviour. I would like analize differences between versions on a proxy variable parser. Another interesting point is that between 1.14.0 and 1.14.1 (until version 1.15.0) looks that even variables about proxy, and proxyBypass on .testcaferc.json file are ignored. |
I can't see in your output proxy, and proxy-ypass definitions. You should have output like this in case of proxy, and proxyBypass use: CLI case: ` ` Configuration case: ` ` |
@sly4you, that's the interesting bit. I can't see the options there; however, I'm running this (from within the docker container): $ testcafe chromium:headless --proxy $HTTP_PROXY --proxy-bypass 172.17.0.2 |
That's the reason because of your issues. It's so clear that from version 1.14.1 options about proxy are not working, unfortunately I don't have enough knowledge to look around the code and discover this bug. Here @miherlosev has written that issue is solved, but output of configuration is still saying differently. :( |
The command-line argument parser is located in the 'node_modules/testcafe/lib/cli/argument-parser.ts' file. |
I think I found the problem, and it's related not during a variables parsing, but during variable merge on file Version 1.14.0 (lines 374,377) Version 1.15.0 (lines 436,440) It looks like that there is no merge on configuration options on last version (1.15.0), and result is that final configuration is without proxy/proxyBypass options. I don't have lot of time to analyse what's the meaning about " this._options.proxy = proxy;", and "this._options.proxyBypass = proxyBypass;", so as a test I have simply modified version 1.15.0 function on this way:
And everything is back to work well, using proxy on .testcafe.json file, and even using proxy definition by cli. I hope it will be useful for you. Cheers :) |
Thank you for the provided information. I've reproduced the problem. For team: testcafe chrome --proxy proxy-host --proxy-bypass 172.17.0.2 |
Hey @VasilyStrelyaev thanks for the follow up. |
http://ipinfo.io/ip does open through HTTP, but Cloudflare wouldn't allow me to connect via the public proxies I managed to find. Can you please try to use HTTP and disable HTTP/2 in your project simultaneously? To disable HTTP/2, use the The limitation due to which TestCafe cannot access HTTPS websites via external proxies is intended and has been in effect since before 1.14.0. I cannot determine the cause of the behavior you see in 1.14.0 without additional investigation. To sum up, you cannot use external proxies for HTTPS and HTTP/2 connections with the current TestCafe version. |
I'm experiencing the same issue that @cyanbutton described with testcafe version 1.15.3. Testcafe seems to just ignore the proxy settings. I use the CLI, not the testcafe runner. When downgrading to testcafe version 1.14.0, the issue is not reproducable anymore. The issues seems to start occuring with version 1.14.1. Hence, I deduce from there that the changes that came with 1.14.1 cause the wrong behavior that we observe. To make sure that version 1.14.0 does not ignore the proxy, I tried the following case successfully: |
Sadly http://ipinfo.io/ip converts to Do we know why TestCafe limited external proxies to only |
Just found http://test-ipv4.com/ that works with |
This is interesting. Our testing server is https, and 1.14.0 works fine. Our proxy server only gets request to the test URL. However, any version above that, our proxy server register this in the logs:
where that IP is the internal IP of the docker container where the tests are running, which means is sending a request to the proxy with the IP address of the container; as it's a local network address, the proxy denies the request. |
+1 same issue that @cyanbutton @mhanci92 are experiencing. After 1.14.0 I'm unable to connect to https sites via proxy. |
@samlin86 , @mhanci92, @cyanbutton did you try to use {
"disableHttp2": true
} Anyway, the fact that you need to enable this option to test the |
@aleks-pro Just tried |
Hi folks, We automatically downgrade the protocol to HTTP 1 if proxy settings are enabled. So, using the |
This issue was automatically closed because there was no response to our request for more information from the original author. Currently, we don't have enough information to take action. Please reach out to us if you find the necessary information and are able to share it. We are also eager to know if you resolved the issue on your own and can share your findings with everyone. |
What is your Test Scenario?
I'm trying to run testcafe in our pipeline (Semaphore) using a docker image based on the official one, where the only additions are copying our tests inside it and install some other additional npm packages used by them. Those tests run against a test environment, that for security reasons can only be accessed either via VPN or a proxy. I'm using the --proxy flag but the test run fails.
From that same container, if I run curl https://mytestserver.dev --proxy $HTTP_PROXY it connects without problems, so does a Cypress container running in the same pipeline.
What is the Current behavior?
Tests fail to run, with the message
As per suggestion here I set
And the log is:
I had the chance to get the logs in our proxy server, and found out this entry coming from the ip in semaphore where the container is running:
Denying access to that request is logical as it points to a local network address.
Incidentally I tried using firefox:headless just in case but found out that the --proxy option is completely ignored.
What is the Expected behavior?
I would expect the hammerhead proxy to issue requests to our proxy with the urls that our tests are visiting, not a local ip address.
Your Environment details:
The text was updated successfully, but these errors were encountered: