Skip to content
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

Cannot load Cypress test runner in 3.3.0 behind proxy #4257

flotwig opened this issue May 20, 2019 · 6 comments

Cannot load Cypress test runner in 3.3.0 behind proxy #4257

flotwig opened this issue May 20, 2019 · 6 comments


Copy link

@flotwig flotwig commented May 20, 2019

Application running in Docker, exposing http://localhost:3000.

Corporate proxy with exceptions given for localhost.

Error received:

Relevant debug log:

cypress:server:server Got CONNECT request from localhost:3000 +320ms
  cypress:https-proxy Writing browserSocket connection headers { url: 'localhost:3000' } +303ms
  cypress:server:cors Parsed URL { port: '3000', tld: 'localhost', domain: '' } +322ms
  cypress:server:server HTTPS request does match URL: https://localhost:3000 with props: { port: '3000', tld: 'localhost', domain: '' } +1ms
  cypress:https-proxy Not making direct connection { url: 'localhost:3000' } +1ms
  cypress:https-proxy Making intercepted connection to 63361 +0ms
  cypress:https-proxy making proxied connection { host: 'undefined:63361', proxy: 'http://proxyhostRedacted' } +0ms
  cypress:network:agent Creating proxied socket for https://undefined:63361 through http://proxyhostRedacted +307ms
  cypress:network:connect successfully connected { opts: { port: 8080, host: 'proxyhostRedacted', useTls: false, getDelayMsForRetry: [Function: getDelayForRetry] }, iteration: 0 } +318ms
  cypress:network:agent Proxy socket for https://undefined:63361 established +11ms
  cypress:https-proxy received upstreamSocket callback for request { port: 63361, hostname: undefined, err: Error: Error establishing proxy connection. Response from server was: HTTP/1.1 403 Forbidden



So I noticed that cypress is trying to use a Proxy socket towards https://undefined, so I added undefined as an exception to the NO_PROXY environment variable in the shell that runs cypress, and everything started working again.

Originally posted by @MichaelHindley in #4235 (comment)

Copy link
Member Author

@flotwig flotwig commented May 20, 2019

@MichaelHindley could you share your full DEBUG logs, please? I think there might be a little more useful information that is missing

Copy link

@david-trejo-ck david-trejo-ck commented May 20, 2019

This solved it for me too 🥇 🎉 thanks @flotwig !

And thanks for 3.3.0!

ENV NO_PROXY=undefined,[...everything you already had in your list]
ENV no_proxy=undefined,[...everything you already had in your list]

(I use both upper and lowercase just in case, b/c that's bitten me before)

Copy link

@MichaelHindley MichaelHindley commented May 21, 2019

@flotwig pastebin with debug logs without the undefined fix:

Copy link

@cypress-bot cypress-bot bot commented May 22, 2019

The code for this is done in cypress-io/cypress#4275, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

Copy link

@petermouton petermouton commented May 22, 2019

I replaced the existing NO_PROXY string with 'undefined' (so I removed everything else) and then I could run the cypress test. (Electron only because if issue #4260)

Copy link

@cypress-bot cypress-bot bot commented May 23, 2019

Released in 3.3.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants