`ensureUrl` failure (potentially due to corporate proxy usage)
See original GitHub issueCurrent behaviour:
Cypress could not verify that the server set as your 'baseUrl' is running:
> https://example.com
Your tests likely make requests to this 'baseUrl' and these tests will fail if you don't boot your server.
Desired behavior:
Tests run after successful ensureUrl
check
How to reproduce:
Run tests over proxy.
Or this might be to do with the fact our baseURL serves 403 responses - which is normal behaviour for us. Our tests query sub-urls, which return 200 responses. This theory is inconsistent with the http://example.com
call failing the ensureUrl
check.
Our hunch is that node’s net.connect
method, used in the ensureUrl check isn’t respecting proxy settings.
https://github.com/cypress-io/cypress/blob/master/packages/server/lib/util/connect.coffee#L10
Additional Info (images, stack traces, etc)
We are able to run via the Cypress UI, but with a warning message in the UI.
When I commented out the following ensureURL
check, tests were able to run.
_this._server.on("upgrade", onUpgrade);
_this._server.once("error", onError);
return _this._listen(port, onError).then(function(port) {
return Promise.all([
httpsProxy.create(appData.path("proxy"), port, {
onRequest: callListeners,
onUpgrade: onSniUpgrade
}), fileServer.create(fileServerFolder)
]).spread(function(httpsProxy, fileServer) {
_this._httpsProxy = httpsProxy;
_this._fileServer = fileServer;
_this._baseUrl = baseUrl;
// if (baseUrl) {
// return connect.ensureUrl(baseUrl)["return"](null)["catch"](function(err) {
// if (config.isTextTerminal) {
// return reject(errors.get("CANNOT_CONNECT_BASE_URL", baseUrl));
// } else {
// return errors.get("CANNOT_CONNECT_BASE_URL_WARNING", baseUrl);
// }
// });
// }
}).then(function(warning) {
_this._onDomainSet(baseUrl != null ? baseUrl : "<root>");
return resolve([port, warning]);
});
});
};
})(this));
- Operating System: RHEL7
- Cypress Version: 1.4.2
- Browser Version: Chome 60
- Node Version: 8.8.0
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Getting Git to work with a proxy server - Stack Overflow
Command to use: git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080. change proxyuser to your proxy user; change proxypwd to your ...
Read more >What is a Proxy Server? How does it work? - Fortinet
How to use a proxy? Some people use proxies for personal purposes, such as hiding their location while watching movies online, for example....
Read more >Intranet site is identified as Internet site - Windows Client
Intranet site is identified as an Internet site when you use an FQDN ... Access will not open the file due to potential...
Read more >Can't clone or pull due to a git outbound proxy
fatal: unable to access 'http://user@host.company.com:7990/scm/en/repo.git/': Failed connect to host.company.com:8080; No error ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is correct,
net.connect
does not respect proxies. We’ll need to switch to using a regular HTTP request whennet.connect
fails or when proxies are set.This issue is still pending release - as indicated by this comment https://github.com/cypress-io/cypress/issues/1541#issuecomment-478424507 and the label of
stage: pending release
.This is not part of 3.2.0. We will comment on this issue as soon as it is released.