-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Cypress cannot load pages behind a corporate proxy #672
Comments
Related issue #584 |
Thank you for the great product! Any news or workarounds on using Cypress behind a corporate proxy? |
Thank you for the great product. I am able to access all the general applications like facebook, gmail so on. Issue is with accessing my application which can be accessible only in my office network. I see runner is trying to invoke the URL but at the end gives an error 'Whoops there is no test to run'. Other sample tests are running fine without any issues. I had a discussion with my IT team and they are not able to help me on this. Any update on this issue?? |
@vjefri03 suggestion does not work for me. |
Oddly, this works perfectly fine for me on a mac. I am VPN'd into my corporate network, which then forces me to use a proxy to go out to the internet. My app loads just fine in Cypress, as do the resources coming off CDNs. I wonder why it would work for some of us and not others? |
Similar setup here: mac with corporate VPN and proxy configured. My app loads ok but CDN content times out. |
Oops. I just created a new ticket describing the same issue as jivimberg, but I'm using Windows. Would be great to have this sorted out, as this testing framework seems to have many advantages over the others. |
I just tried troubleshooting to see why my setup works when others' do not. I removed my proxy settings from the VPN network settings and experienced the same behaviour as the others (no external sites would load). Once I added them back, still no external sites would load. The only way I've gotten things to work is by running the tests once while not connected to the VPN, then they seem to work correctly afterwards when connected to the VPN (this is obviously not a solution for people trying to use Cypress from work). So I am concluding that this never properly worked for me over the VPN, I just thought it did. I would very much like to see this issue get fixed so my team can try using Cypress on a few projects :) Let me know what I can do to help. |
Since Cypress acts as a reverse proxy to the browser (which also ends up terminating traffic amongst other things), when it makes the external requests to 3rd party servers, it needs to respect the system proxy settings. That's why this is failing. If Cypress proxied itself to the upstream proxy of the system, then all would work. This is likely a change that only needs to be made in a few places. The trick here is that we need a reproducible repo or the minimum steps to reproduce so we can write tests to ensure this is working. Until someone does that, there are other things that will take priority over this feature. |
Well isn't the requirement here for reproduction a VPN where a proxy is required to get out to the internet? It doesn't actually have anything to do with the repo itself, or am I missing something? |
That is true. However, you could likely put together a repo involving a transparent or reverse proxy that the traffic must tunnel through before hitting a regular http server. The thing here is that I'm not sure if Cypress is supposed to read off the "corporate proxy" settings from the operating system itself - or if we need to expose configuration via In other words - help us implement the exact steps needed to reproduce the failing environment so we can implement a solution to it. Even referencing other tools that do work would be helpful so we can look at how they solve this. |
I can't see why Cypress wouldn't automatically use the system's proxy settings when it can. That would be my vote. Its also what most apps have done in my experience sitting behind our pointless corporate proxy. As an aside, I have also tried adding environment variables (http_proxy, https_proxy) to the |
Right - so we can definitely respect the |
Can you do an experiment - open node (any version) and check Or you could also just do |
No, I cannot see either |
They are not added to Update How to manage the proxy in ZSH...or one way to do so at the very least. |
I would be happy with this working from the |
Yes it looks like we can simply expose a new set of configuration in |
@brian-mann |
We already turn off strict SSL handling in Cypress since Cypress itself is a proxy that issues invalid on the fly certificates. Can anyone reference me another application that exposes the kinds of proxy configuration settings that is required here? I am still at a loss as to how many fields would need to be added to |
How about npm ? https://docs.npmjs.com/misc/config#https-proxy It turns out that setting |
@brian-mann see above ZSH proxy setter. At a minimum In my corporate environment, all SSL connections are terminated at the proxy, so HTTPS and HTTP setting are identical. The UPPER and lower case versions are to cover a couple of edge cases where some programs don't recognize the conventions, e.g., |
After some experimentation, it appears cypress respects most of the environment proxy variables once they are set. If I set For some reason, resources over https were not sent through the proxy, even though I had also set the @jivimberg Did you (or could you) try running cypress after setting both In summary, I think cypress should support at a minimum the following environment variables: |
I tried with the 3 variables set and it's working! |
Looks like i am experiencing the same behaviour on a centos container where i can curl towards an https url but if i set this as my baseUrl it does not work. HTTPS_PROXY and https_proxy both are set. |
The code for this is done in cypress-io/cypress#3531, but has yet to be released. |
Released in |
Resolved: Had a similar issue. ### Windows only |
I m facing similar issue, however in Windows 10 running following command tells me that there is no proxy server: However, URL: https://download.cypress.io/desktop/3.4.1?platform=win32&arch=x64 |
@RupenAnjaria Please make sure to follow the directions on proxy setup from our docs: https://on.cypress.io/proxy-configuration#Windows |
So I manually downloaded Cypress and opened it along with my project. Upon settings -> Proxy Settings displays message: There is no active proxy configuration. |
@RupenAnjaria Does your environment require a proxy to access the Internet? The message that the CLI gives is generic, if you do not usually need a proxy you do not need to set one up. |
If I can not add it via |
@RupenAnjaria You can download that |
Download |
The URL that you've blacked out in the image you shared. |
it's a |
Yeah, the proxy IP and PORT are in that Javascript. Figure out what IP and host are used for external traffic and set that to your HTTP_PROXY (ex, |
I tried but they did not understand :( , can I install it without npm? any link/reference which can help to use cypress (without npm proxy setup?) |
the standard https://docs.npmjs.com/misc/config#strict-ssl didn't work, but setting the environment variable |
not for me :( |
I am running into this issue upon trying to deploy to Netlify. The deployment is failing because Cypress could not be downloaded. |
This issue will be closed to further comment as the exact issue here was resolved and tested. If you're experiencing a bug similar or that seems related to this in Cypress, please fully read and following the instructions in our Proxy Configuration doc: https://on.cypress.io/proxy-configuration If you're still experiencing an issue, open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix. |
Is this a Feature or Bug?
Feature
Current behavior:
When running on a machine that requires a corporate proxy, cypress does not use the proxy settings and therefore cannot access and run tests on pages behind the proxy.
Desired behavior:
Cypress should respect the internal proxy settings of the network. From Brian Mann in Gitter:
"right i think its something we'll have to take into account and upgrade
cypress does not respect the internal proxy settings of the network
it would just work if we took that into account though"
Additional Info (images, stack traces, etc)
Resolving this would allow teams behind corporate proxies to adopt the software.
The text was updated successfully, but these errors were encountered: