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.

Experimental feature: disableProxy

See original GitHub issue

What would you like?

This has been raised in the past, but the original author gave up on it (and Cypress, unfortunately). Closed (but not resolved) issue is here for context: https://github.com/cypress-io/cypress/issues/22319#issuecomment-1355431707

This feature would add the experimental option to completely disable the Cypress proxy and let the running browser (and Cypress) speak directly to the network.

Why is this needed?

As explained in the docs, Cypress uses a proxy for, among other things, modifying code which potentially would break Cypress during runtime. However, the docs also acknowledge that not all sites are affected by such code, and even provides an option (modifyObstructiveCode) which partially disables it. The proxy is also used for several other features.

However, the proxy also incurs several notable penalties:

So while the proxy certainly has important uses, there should be an option to disable it completely if a team determines they have no use for the extra functionality and would like to optimise performance instead.

Other

While I advocate for Cypress personally at my workplace, I am seeing rising pressure from colleagues to consider Playwright instead - primarily due to performance reasons. The author of the original issue ended up doing the same.

I love Cypress approach to testing, but I can only acknowledge that performance is - and has been for years - one of the primary weaknesses of the framework. The team has done impressive work over the last releases (especially in 9 and 10) to address many sticking points, but much more needs to be done in order to level the playing field with competing solutions - especially Playwright. I believe this would be a step in the right direction.

Issue Analytics

  • State:open
  • Created 9 months ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
lmiller1990commented, Dec 21, 2022

It would be helpful to know if there is anything in the proxy without Cypress cannot function altogether

This is what I am trying to find out. I’m sure there is something around how Cypress injects itself - whether we can decouple that and have some option to make the proxy do less and thus improve performance is another question.

@adam-thomas-privitar I think that’s actually a bug that is fixed by https://github.com/cypress-io/cypress/pull/25209. You can test this out right now by installing the pre-release with that patch: https://github.com/cypress-io/cypress/commit/6b78454e0d78346729263e5ab0b77c856a43ce42#comments. If you do try it, let me know if it helps. I also want to use Vite and I want to go fast.

Edit you tried it, thanks! I still think we can go faster, but if you see anything that seems like it’s unusually slow, it’s probably a bug - you should create an issue.

2reactions
lmiller1990commented, Dec 20, 2022

I am also curious about this. My understanding is Cypress cannot function without some sort of network proxy. Not only do many features depend on it, but I (think) there’s some fundamental requirement for some sort of network proxy (could be mistaken, but the concept of a network proxy has been in Cypress since the very early days, far before things like cy.intercept existed.

Whether we can make some of the features opt-in or opt-out would be another discussion.

Before doing this, since the goal is to go faster, there’s a better alternative - updating our network stack to some more modern libraries, and using HTTP/2, which is up to 10x faster. I think this would help greatly with performance.

There is an issue tracking that here: https://github.com/cypress-io/cypress/issues/3708.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Experimental Features - Using Minishift - OKD Documentation
This will start a proxy server on the host which will be automatically assigned to the Minishift instance. When the corporate or upstream...
Read more >
Experimental flags | CDP Public Cloud
Experimental flags. Some configuration flags are marked 'unsafe' and 'experimental'. Such flags are disabled by default. You can access these flags by ...
Read more >
Proxy Support on Kubernetes - Tekton
This functionality of adding proxy environment variables is not available on taskruns created in ... operator.tekton.dev/disable-proxy: true ...
Read more >
Setup Visual Studio Code's Network Connection
A handful of features within VS Code require network communication to work, such as the auto-update mechanism, querying and installing extensions, ...
Read more >
Docker Desktop for Mac Edge release notes
Note that some of the features may be experimental, and some of them may not ever reach ... More explicit proxy settings; You...
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