mirror of
https://github.com/yudai/gotty.git
synced 2025-09-22 05:50:48 +02:00
Enable gzip compression
This commit is contained in:
parent
024ab8f28e
commit
48c91151ad
10 changed files with 634 additions and 1 deletions
|
@ -14,6 +14,7 @@ import (
|
|||
noesctmpl "text/template"
|
||||
"time"
|
||||
|
||||
"github.com/NYTimes/gziphandler"
|
||||
"github.com/elazarl/go-bindata-assetfs"
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/pkg/errors"
|
||||
|
@ -197,7 +198,8 @@ func (server *Server) setupHandlers(ctx context.Context, cancel context.CancelFu
|
|||
siteHandler = server.wrapBasicAuth(siteHandler, server.options.Credential)
|
||||
}
|
||||
|
||||
siteHandler = server.wrapLogger(server.wrapHeaders(siteHandler))
|
||||
withGz := gziphandler.GzipHandler(server.wrapHeaders(siteHandler))
|
||||
siteHandler = server.wrapLogger(withGz)
|
||||
|
||||
wsMux := http.NewServeMux()
|
||||
wsMux.Handle("/", siteHandler)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue