mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-04 00:31:10 +08:00
25w12b
This commit is contained in:
parent
c184e46917
commit
efdf5b0221
8 changed files with 136 additions and 4 deletions
11
main.go
11
main.go
|
|
@ -12,8 +12,10 @@ import (
|
|||
"ghproxy/api"
|
||||
"ghproxy/auth"
|
||||
"ghproxy/config"
|
||||
"ghproxy/loggin"
|
||||
"ghproxy/proxy"
|
||||
"ghproxy/rate"
|
||||
"ghproxy/timing"
|
||||
|
||||
"github.com/WJQSERVER-STUDIO/go-utils/logger"
|
||||
|
||||
|
|
@ -124,7 +126,16 @@ func init() {
|
|||
|
||||
gin.LoggerWithWriter(io.Discard)
|
||||
router = gin.New()
|
||||
|
||||
// 添加recovery中间件
|
||||
router.Use(gin.Recovery())
|
||||
|
||||
// 添加log中间件
|
||||
router.Use(loggin.Middleware())
|
||||
|
||||
// 添加计时中间件
|
||||
router.Use(timing.Middleware())
|
||||
|
||||
//H2C默认值为true,而后遵循cfg.Server.EnableH2C的设置
|
||||
if cfg.Server.EnableH2C == "on" {
|
||||
router.UseH2C = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue