Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2023-12-04 23:48:16 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2023-12-04 23:48:16 +0300
commit75fb66ade093c561225738e2d5cc2126c15d2776 (patch)
tree3078a5c20a5f0c512e4d6d27a96cdea4d2f8cd94 /web
parente677069d812ee0b673556f64d44ed1e94ebca33f (diff)
gzip compression
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
Diffstat (limited to 'web')
-rw-r--r--web/web.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/web/web.go b/web/web.go
index abf2d6c1..a8c49ce5 100644
--- a/web/web.go
+++ b/web/web.go
@@ -25,6 +25,7 @@ import (
sessions "github.com/Calidity/gin-sessions"
"github.com/Calidity/gin-sessions/cookie"
+ "github.com/gin-contrib/gzip"
"github.com/gin-gonic/gin"
"github.com/robfig/cron/v3"
)
@@ -174,6 +175,7 @@ func (s *Server) initRouter() (*gin.Engine, error) {
if err != nil {
return nil, err
}
+ engine.Use(gzip.Gzip(gzip.DefaultCompression, gzip.WithExcludedPaths([]string{basePath + "xui/API/"})))
assetsBasePath := basePath + "assets/"
store := cookie.NewStore(secret)