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
cypress.json:

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_
@MichaelHindley could you share your full DEBUG logs, please? I think there might be a little more useful information that is missing
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)
@flotwig pastebin with debug logs without the undefined fix:
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.
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)
Released in 3.3.1.
Most helpful comment
Released in
3.3.1.