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

Proposal: Fix corporate proxy issues #1469

Open
jennifer-shehane opened this Issue Mar 16, 2018 · 6 comments

Comments

6 participants
@jennifer-shehane
Member

jennifer-shehane commented Mar 16, 2018

Problem

There are several users with corporate proxy issues that are faced at several layers of interacting with Cypress including during:

Current workarounds:

Setting environment variables

Note: these are NOT cypress environment variables, but system/shell environment variables

  • If using Linux, you can read about setting and reading env variables here
  • If using Windows, you can read about setting and reading env variables here

Set HTTP_PROXY and/or HTTPS_PROXY to your corporate proxy

HTTP_PROXY=http://my-proxy-address cypress run

Set NO_PROXY for localhost to prevent it from hitting corporate proxy

NO_PROXY=localhost cypress run

Other workarounds

For cy.visit()

For Download

For accessing 'Runs' tab in Test Runner

  • If you need to set up a project, you have to do it in this tab. Fortunately, you should only need to do this once. Try to do this once outside of the corporate proxy then you should be good to go.
@furnace915

This comment has been minimized.

furnace915 commented May 11, 2018

setting the environment variables was very helpful for the npm install on Mac. thx for workaround

@murugaratham

This comment has been minimized.

murugaratham commented Jul 5, 2018

Tried setting env using cross-env HTTPS_PROXY=<my corp proxy> as well as HTTP_PROXY, but request to external resource gets http 407. I am using cntlm and set proxy to go through cntlm, but still unable to get CDN resources, e.g. google fonts

@Rende11

This comment has been minimized.

Rende11 commented Jul 18, 2018

Tried do this:

PROXY_HTTP="http://proxy.adress" PROXY_HTTPS="https://proxy.adress" npx cypress run --spec cypress/integration/ah-ui.js -b chrome

With electron too, added rules in extension, add extension with VPN, added proxy settings in chrome...
but it doesn't work for me - best result - I can open url in new tab.
In Cypress test I receive -

CypressError: cy.visit() failed trying to load:

https://mytestsite

The content-type of the response we received from your web server was:

  > null

This was considered a failure because responses must have content-type: 'text/html'
@tommorganshaw

This comment has been minimized.

tommorganshaw commented Aug 15, 2018

I've read everything I can find on this issue and tried every suggested workaround but Cypress still cannot connect to websites through our corporate proxy.

When will this feature be implemented? It is a massive blocker for any possibility of adoption within our team.

@jennifer-shehane

This comment has been minimized.

Member

jennifer-shehane commented Aug 15, 2018

@Rende11 See this comment regarding null content-type responses #1727 (comment)

@alvarofernandoms

This comment has been minimized.

alvarofernandoms commented Oct 1, 2018

Did you try to set the corporate proxy into npm config? Like so: https://stackoverflow.com/a/33892578

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment