You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using it to build a mobile web app. This web app needs to connect to the device's camera. We would like to accomplish this using VinceG/vue-web-cam#45, but as per that issue, the page needs to be running in https in order for this to work.
It seems to me that the documentation for getting this to run with https assumes that this is happening on a VPS. What is the simplest way to get this to run with https locally?
Here's an extremely hacky workaround using https://github.com/rchampourlier/tunnelss. Assuming your development server's LAN IP is 192.168.0.98, and you want to access it with https on iOS:
(You will also need to set VUE_APP_DOMAIN_DEV=192.168.0.98 in frontend/.env.)
The main drawback of this is that you need to restart the frontend via docker-compose every time you make a change, since vue-cli-service serve --https only generates a certificate for localhost, which won't work if you're accessing it over a LAN. To work around this, we can use tunnelss again:
Activity
lesourcil commentedon Oct 29, 2020
Im not using Swarm and I'm exactly trying to figure out the samething. No matter what i change in docker-compose for treafik, it doesn't work.
Still searching ...
abrichr commentedon Oct 29, 2020
Here's an extremely hacky workaround using https://github.com/rchampourlier/tunnelss. Assuming your development server's LAN IP is 192.168.0.98, and you want to access it with https on iOS:
Now https://192.168.0.98 proxies to http://localhost, and serves a certificate that is good enough for iOS Safari.
(You will also need to set
VUE_APP_DOMAIN_DEV=192.168.0.98infrontend/.env.)The main drawback of this is that you need to restart the
frontendvia docker-compose every time you make a change, sincevue-cli-service serve --httpsonly generates a certificate forlocalhost, which won't work if you're accessing it over a LAN. To work around this, we can usetunnelssagain:(This will also require adding https://192.168.0.98:8080 to
BACKEND_CORS_ORIGINSin.env.)Now you can access https://192.168.0.98:8080 on iOS Safari with hot reloading.
It would be great if there was a supported way to get https working locally!
haviduck commentedon Nov 2, 2020
tried setting https true in vue config?
abrichr commentedon Nov 2, 2020
@haviduck can you please clarify what you are referring to more specifically? Which vue config?
haviduck commentedon Nov 3, 2020
i havent tried it myself, but id try changing up the envs.
https://github.com/tiangolo/full-stack-fastapi-postgresql/blob/490c554e23343eec0736b06e59b2108fdd057fdc/%7B%7Bcookiecutter.project_slug%7D%7D/frontend/src/env.ts#L10
and on serve you can try the various vue cli options like --host and --port
https://github.com/tiangolo/full-stack-fastapi-postgresql/blob/490c554e23343eec0736b06e59b2108fdd057fdc/%7B%7Bcookiecutter.project_slug%7D%7D/frontend/package.json#L6
so "bla bla serve --host 127.0.0.1 --port 443
if This is for development, id keep it simple and Just do chrome://flags/#allow-insecure-localhost
theres also this
https://github.com/tiangolo/full-stack-fastapi-postgresql/tree/master/%7B%7Bcookiecutter.project_slug%7D%7D#development-in-localhost-with-a-custom-domain