This repository has been archived by the owner on Jul 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Experiment: Add a custom proxy to automate Lighthouse testing #98
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hey @DAreRodz, are you still working on this? |
@luisherranz, not really. And I would say there's no need to keep working on this (at least in the short term). I've seen you've been closing issues and PRs lately, so if you also want to close this one, feel free. 🙂 |
Ok. Thanks, David! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This experiment introduces a MITM proxy to intercept HTTP calls and inject our hydration library into the HTML response. The proxy is useful for automated testing with Lighthouse, which doesn't allow us to modify the HTML code of the page requested.
The library I used to build the proxy is https://github.com/joeferner/node-http-mitm-proxy. I think it's not a production-ready library, although it works well for this test. It's worth mentioning that the proxy server downgrades the performance a bit, but it could still be useful to get comparable data.
To start the proxy and the tests, you would run the following:
For the proxy to work with HTTPS, you must install the generated
.http-mitm-proxy/certs/ca.pem
certificate. To do that, you need to execute the following script:Some next tasks could be: