-
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 behind corporate proxy with cross-domain static content times out #2295
Comments
i have the same problem :( |
Ive found that forcing this line to be true So i believe this supports the above statements, that doing a direct connection means that the proxy env settings are not being respected. Doing a truely "direct direct" connection is not right, we need a "direct via corp proxy" :P Now i have no idea how to test this in cypress as i only just picked up the code yesterday :P so looking for some help !!!, id really like to get this working asap. If anyone can point me in the right direction, please and thanks |
I'm having the same issue, 504 timeout when trying to download cdn
|
Did some more digging and i think issue is in if you dont do a direct connection the lib uses https://www.npmjs.com/package/request which has env proxy stuff built in. Thus if you do this https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/server.coffee#L186 My question is why not just use the Wondering when this will be fixed? @jennifer-shehane. Is there any place i can go to get more depth details on the workings of cypress internals to hopefully help you out ? |
With the workaround @timpur described we proofed that it's not a problem of our proxy. But having this manual change in the code wouldn't allow us to update if there is a newer version of Cypress, so this is a blocker for us to use Cypress. Are there plans to fix this issue? |
You can fix this by using redsocks transparent proxy. But that's quite a bit of work to configure properly. But it does work. |
Same issue |
Just to confirm that @timpur's workaround fixes the problem for us - keen to know if this is on the teams radar as currently it's a blocker stopping us from using Cypress. |
Another update - just to confirm for us this seems to be around using cdn assets with https protocol. Non-https assets are working fine. |
same issue here, direct connect should respect proxy settings i guess |
Any movement on this? Currently it's blocking us adopting in house for a number of projects. |
@Carst-Tankink I am able to run the test with the url from the screenshot If you have a new example test I am supposed to be running, please comment here. Possible related issue: #1039 |
Seems odd that the current logic is to not respect the proxy on direct connections. I would suggest this could be decided by the user with the |
Having the same problem behind corporate proxy. In our case is blocking because our AngularJS app is using Google Maps library that must be loaded. |
@jennifer-shehane Could you try with the url For us, this issue isn't that pressing anymore, as we're using the solution/workaround that @meinaart mentioned. |
@maapteh - Sadly we've had to look elsewhere now because of the slowness to fix these proxy issues. |
In my case it was only Google Maps that tried to load from Google CDN.
cy.on("window:before:load", win => {
win.google = {
maps: {
places: {
Autocomplete: {}
}
}
}
}) In my case it's Angular 1.x app that need to load Google Maps API on startup, otherwise it's failing. |
Thats a workaround but it will not work if your assets are needed for your app to bootstrap (Angular, React, Vue, Etc) :) And @leepowellcouk it seems from a quick glance PR #3531 is fixing it, but i don't understand why you would OS a JavaScript project written in Cofee script, less people will add fixes. |
The code for this is done in cypress-io/cypress#3531, but has yet to be released. |
Just tried this on the |
Seems that if proxy settings are set in uppercase things don't work, so have to to use lowercase:
|
@leepowellcouk Which part of it isn't working with uppercase variable names? It was tested with the expectation that users would use uppercase variable names, so it should work. Can you let me know what type of URL you're trying to load (HTTP/HTTPS) and your operating system? |
@flotwig Requests to external assets over http fail with a timeout. Operating system is OS X. Changing to lowercase and it works for me. |
@leepowellcouk This is the line of code that decides if your request gets sent through an HTTP proxy or just sent normally: cypress/packages/network/lib/agent.ts Line 153 in c1a345d
All HTTP requests go through this as of #3531. It checks for Are you sure you've pulled down the latest |
This is one of the assets we are trying to access: |
Yes I'm definitely on |
Can you share the debug logs from that failing run? It might help to shed some light on the issue. Just run your Cypress command like this:
|
Sure - do you want me to post it here, or email you? |
Here should be fine. |
@leepowellcouk Got your log, it looked you might have accidentally included some identifying information in it so I deleted your comment. Looking over it now. Thank you for helping to debug this issue! |
@leepowellcouk I think that there's an
|
Ah sorry, I had all those disabled this morning when I was trying to get this to work - give me a sec and I'll run it again with all those disabled - do you have an email I can send the new log to? |
Ah, that's it ... I could of sworn I had that disabled this morning! Working as expected now. Thanks for taking the time to look at. |
Great! Glad you got it working. #3866 will make this less confusing, as it will always use the lowercase variables if they're available before using the uppercase ones. |
@flotwig Would be great to maybe add this as part of the new Proxy Configuration docs - just how to list the environment variables that are set on your machine. |
Released in |
Quite useless with no support of automatic configuration.
but is really a good starting point for sure |
Btw, this fix doesn't work for me at all. It is even worse than before, loading of site is not even started, getting Running tests like this Before it was working bad, slowly but at least somehow by running |
Same here - this fix made things worse for us. We get a websocket connection error when trying to connect to a StoryBook instance:
|
@xlenz We decided not to add PAC support as it would greatly increase the complexity of the implementation, and as you've discovered, it's trivial to just use your proxy URL directly. @leepowellcouk @xlenz If you could share your full DEBUG logs as described here: https://docs.cypress.io/guides/guides/debugging.html#Print-DEBUG-logs ...that would help to debug the issue and improve proxy support in the next release. Right now, I'm guessing you're both experiencing #4257, but there could be something else at play. |
@flotwig - Thanks! That was exactly the issue for me. Adding |
@leepowellcouk Great, glad to hear that the workaround worked for you. Don't worry about the |
Hi! If your organization uses a PAC file, contact a network administrator to ask what HTTP proxy you should be using to access the general Internet, then use that proxy with Cypress. However, I can't use a proxy for my project, because "internal" calls should be called just without a proxy. This is the response from the support team (from my organization): Please clarify with cypress team, if no PAC can be used, then tool must be adjusted so that no proxy is used, because "internal" calls should be called just without a proxy. My question is: it is possible to adjust so that no proxy is used? Thanks! I tried with
and |
@catalin7mar You can disable proxy usage by passing You can view your current, resolved proxy configuration by following these instructions: https://docs.cypress.io/guides/references/proxy-configuration.html#View-proxy-settings-in-Cypress There is also more info about setting up a proxy on that page. If it's not working as expected, please open up a new issue so we can figure out what's not working for you. |
This is probably one of the instances of problems caused by cypress behind a corporate proxy (#1469), but I haven't seen a bug report that is similar to this, so let me file it here :-)
Current behavior:
We are running cypress in a docker container (started from jenkins) behind a corporate proxy. I am passing the proper
http_proxy
,https_proxy
andno_proxy
env variables.As a minimal test case, we are doing:
This fails with a timeout, but it does seem able to fetch the HTML (see screenshot)
I think the problem comes from the fact that we are serving our static content, including javascript, fonts and css, from a different superdomain (https://s.s-bol.com). In the debug logging of cypress, we see repeats of this:
With the direct connection not being passed through our proxy, and eventually timing out. This is supported by the fact that a slightly different test setup where the static content is served from the superdomain do pass. The setup of our proxy seems okay: when I do a
curl
for static content from the same docker container, it passes through (and times out when the proxy-settings are absent)Desired behavior:
The basic test succeeds
Versions
Cypress: 3.0.3
OS: Linux (dockerized)
Browser: Electron
If there is anything you want me to try or add, please ask! We are absolutely loving cypress for testing standalone components in isolation and really want to roll it out to doing integration tests.
The text was updated successfully, but these errors were encountered: