trunk
trunk copied to clipboard
Support serving over TLS
Some web application features (e.g., accessing the clipboard) is restricted to localhost and https pages for security/privacy reasons. However, sometimes you'll want to test the application from another device (e.g., smartphone) so you'd need https for these features to work.
Currently my workaround is to use a python web server launched in the dist/ directory which uses a TLS certificate generated on startup. Unfortunately, using this approach one loses the auto-reload feature. Another possible workaround would probably be to setup a proxy that also passes through websockets to trunk.
However, the easiest way in the long-term would be that trunk serve directly supports https. Ideally with both, tls certificate generated at startup and using a previously generated certificate.
I understand that this might not be a priority for now but I still wanted to drop the suggestion. Unfortunately, I don't think that I have enough time implementing it myself in the weeks to come.
+1 please, as it seems HTTPS is one of the requirements for PWAs. My workaround is similar, using https://github.com/joseluisq/static-web-server (Rust) and https://github.com/FiloSottile/mkcert (Go).
+1, I also need this
+1
+1, currently using a (kind of hacked-together) fork (https://github.com/thedodd/trunk/compare/master...murosuke:trunk:develop) for this.
@thedodd It would be really nice if this could be merged and released.
Update: https://github.com/thedodd/trunk/pull/532 was merged into trunk-ng. Use https://crates.io/crates/trunk-ng.
+1, just to pop up this issue for the author
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
The workaround is indeed to use mkcert and some local proxy. The documentation needs to be updated to show that trunk actually already supports this use case, but the feature is currently undocumented, waiting on my PR to alert others to it: https://github.com/thedodd/trunk/pull/611/files
This was merged back into trunk (from trunk-ng) and is released with trunk 0.18.0.