Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andreros/9cf2fbeffd8195710cb57fc854ce2e24 to your computer and use it in GitHub Desktop.
Save andreros/9cf2fbeffd8195710cb57fc854ce2e24 to your computer and use it in GitHub Desktop.
How to run a React application in HTTPS mode locally on MacOS
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