mirror of
https://github.com/Luzifer/expose.git
synced 2024-12-22 19:01:21 +00:00
Support gzip compression on server
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
647f50effc
commit
48b6fcf4c5
1 changed files with 3 additions and 1 deletions
|
@ -8,6 +8,8 @@ import (
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
|
||||||
"github.com/Luzifer/expose/ngrok2"
|
"github.com/Luzifer/expose/ngrok2"
|
||||||
|
http_helper "github.com/Luzifer/go_helpers/http"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -43,7 +45,7 @@ var serveCmd = &cobra.Command{
|
||||||
return fmt.Errorf("Unable to create tunnel: %s", err)
|
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)
|
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)
|
c := make(chan os.Signal, 1)
|
||||||
|
|
Loading…
Reference in a new issue