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.
Added a --https flag to allow
cap runto use https instead of http.This should address #8049.
For example, now running with --https flag, cap cli will have:
Live reload remote
It works out of the box.
e.g.
cap run android -l --host=capacitorjs.com --https --port=443Live reload local https server
Using --https may cause capacitorjs not to load the content in WebView if the web view has a self-signed SSL certificate.
My local workaround (fully local, but make your own CA):
For local development, I ended up working around this by making a local CA certificate, and sign server certificates with this CA. Then I would need to install the CA file on my android device. Now live reloading a https local dev server is possible.
For nextjs:
If you have run
next dev --experimental-httpsbefore, delete ./certificates folder. Then continue.Do the below in
./certificatesfolderUse devCA.key to install on device later.
openssl genrsa -out devCA.key 2048 openssl req -x509 -new -nodes -key devCA.key -sha256 -days 3650 -out devCA.crt -subj "/CN=Local Development CA"e.g.
devCA.crton Android.First, copy
devCA.crtfrom PC to you android device. On Android, go to "settings -> security and privacy -> more security settings -> install from device storage -> CA certificate", then locatedevCA.crtand install.Now you can go back to root folder. Run
next dev --experimental-https, and runcap run android -l --host=mypc --https. Finally you should be able to see your local https server.Other options
Maybe try Ngrok (untested)