http-server
http-server copied to clipboard
Let's Encrypt HTTPS support
Several users have been able to successfully deploy http-server if they reverse-proxy it from Cloudflare and using a relaxed https-to-http connection between Cloudflare and the origin.
We should be able to support Let's Encrypt auto-certificates by leveraging Caddy's certmagic package.
At the core, it would be a matter of replacing the listener with:
err := certmagic.HTTPS([]string{"example.com", "www.example.com"}, mux)
if err != nil {
return err
}
Which per the certmagic documentation, it will redirect http to https traffic.
am using it with traefik and it works very good. just fyi.