- Generate Self-Signed Certificate - Linux/Mac
openssl genrsa -out ./my-certificate.key 2048
openssl req -x509 -new -nodes -key ./my-certificate.key -days 1024 -out ./my-certificate.crt -subj "/C=US/ST=Utah/L=Provo/O=ACME Signing Authority Inc/CN=hoxyproxy.com"
or the one-liner which generates both the certificate and the key
openssl req -x509 -new -nodes -newkey rsa:2048 -keyout ./my-certificate.key -days 1024 -out ./my-certificate.crt -subj "/C=US/ST=Utah/L=Provo/O=ACME Signing Authority Inc/CN=hoxyproxy.com"
- Install certificate
-
Linux: neeed to make Chrome trust the self-signed certificate - Settings → Privacy and security → Security → Manage certificates → Authorities - Click on Import and then import the generated certificate (e.g.
my-certificate.crt
) - In Trust Settings check the "Trust this certificate for identifying websites" checkbox and save the modifications -
Mac: https://www.eduhk.hk/ocio/content/faq-how-add-root-certificate-mac-os-x
- Install npm packages
- this project uses the Web Sniffer npm package which needs to be installed
npm install web-proxy-sniffer
- Run proxy
node proxy.mjs <path_to_HAR_file>
- SwitchyOmega Chrome extension
Install https://chrome.google.com/webstore/detail/proxy-switchyomega/padekgcemlokbadohgkifijomclgjgif?hl=en
In your proxy
profile, make sure that:
- the
server
islocalhost
- the
port
is8080
- the
Bypass List
is empty
It should finally look like this:
Now, all you have to do is:
- change the proxy to
proxy
from the SwitchyOmega Chrome extension's popup panel - navigate to the page where the HAR file was captured from
- be happy or sad (depending on the results)
Warning: This approach is still in its early stages and experimental, please use node
v14.x.x
Here is how to configure the proxy settings manually for your browser session, in case you don't want to use SwitchyOmega.
After you started the proxy server (as indicated in step 4), open a separate terminal window and run:
google-chrome-stable --proxy-server="http://localhost:8080" --proxy-bypass-list="<-loopback>"
google-chrome-stable
can also be replaced with google-chrome-beta
or chromium
(or the path to the Chrome/Chromium executable on your machine)