question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot load Cypress test runner in 3.3.0 behind proxy

See original GitHub issue

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

Corporate proxy with exceptions given for localhost.

Error received: image

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

cypress.json:

image

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 https://github.com/cypress-io/cypress/issues/4235#issuecomment-493857240_

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
cypress-bot[bot]commented, May 23, 2019

Released in 3.3.1.

1reaction
MichaelHindleycommented, May 21, 2019

@flotwig pastebin with debug logs without the undefined fix:

https://pastebin.com/rpNR5QEG

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | Cypress Documentation
Open Cypress via cypress open · Go to Developer Tools -> View App Data · This will take you to the directory in...
Read more >
Setup Cypress.io to access a page through a proxy
Solution: I used the NO_PROXY=localhost HTTPS_PROXY=mycompanyproxy.com:443 while running the cypress tests as env variable. Ex:
Read more >
cypress-io/cypress - Gitter
need help any recommendation where i can test my app with javascript off? ... After installing 3.3.0, behind corporate proxy the tested page...
Read more >
JavaScript and TypeScript Tests - Datadog Docs
If you are running tests on an on-premises CI provider, such as Jenkins or self-managed GitLab CI, install the Datadog Agent on each...
Read more >
Run your Cypress tests from behind a proxy - BrowserStack
Guide for running your Cypress tests when your application is behind a proxy. If you have correctly set up Local Testing but are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found