Last active
October 6, 2023 11:08
-
-
Save andreros/9cf2fbeffd8195710cb57fc854ce2e24 to your computer and use it in GitHub Desktop.
How to run a React application in HTTPS mode locally on MacOS
This file contains hidden or 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
Pre requisites: | |
- Homebrew | |
Execute the following commands: | |
``` | |
brew install mkcert | |
// needed for firefox specifically | |
brew install nss | |
mkcert -install | |
mkcert localhost | |
sudo npm install -g local-ssl-proxy | |
// needs to be running | |
local-ssl-proxy --source 3010 --target 3000 --cert localhost.pem --key localhost-key.pem | |
``` | |
HTTP port where the React app is running locally: | |
``` | |
--target 3000 | |
``` | |
Port where the React app HTTPS proxy will be served: | |
``` | |
--source 3010 | |
``` | |
Access HTTPS on the `https://localhost:3010` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment