1
0
Fork 0
mirror of https://github.com/Luzifer/expose.git synced 2024-11-09 23:00:12 +00:00

Support gzip compression on server

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-09-17 21:23:57 +02:00
parent 647f50effc
commit 48b6fcf4c5
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -8,6 +8,8 @@ import (
"os/signal"
"github.com/Luzifer/expose/ngrok2"
http_helper "github.com/Luzifer/go_helpers/http"
"github.com/spf13/cobra"
)
@ -43,7 +45,7 @@ var serveCmd = &cobra.Command{
return fmt.Errorf("Unable to create tunnel: %s", err)
}
go http.Serve(listener, http.FileServer(http.Dir(".")))
go http.Serve(listener, http_helper.GzipHandler(http.FileServer(http.Dir("."))))
fmt.Printf("Created HTTP server for this directory with URL %s\nPress Ctrl+C to stop server and tunnel", tun.PublicURL)
c := make(chan os.Signal, 1)