mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-04 00:31:10 +08:00
25w48b
This commit is contained in:
parent
cf5ae0d184
commit
fd7e270db4
10 changed files with 56 additions and 21 deletions
12
main.go
12
main.go
|
|
@ -431,6 +431,7 @@ func main() {
|
|||
server.WithHostPorts(addr),
|
||||
server.WithTransport(standard.NewTransporter),
|
||||
server.WithStreamBody(true),
|
||||
server.WithIdleTimeout(30*time.Second),
|
||||
)
|
||||
r.AddProtocol("h2", factory.NewServerFactory())
|
||||
} else {
|
||||
|
|
@ -438,6 +439,7 @@ func main() {
|
|||
server.WithHostPorts(addr),
|
||||
server.WithTransport(standard.NewTransporter),
|
||||
server.WithStreamBody(true),
|
||||
server.WithIdleTimeout(30*time.Second),
|
||||
)
|
||||
}
|
||||
} else if cfg.Server.NetLib == "netpoll" || cfg.Server.NetLib == "" {
|
||||
|
|
@ -447,6 +449,7 @@ func main() {
|
|||
server.WithHostPorts(addr),
|
||||
server.WithSenseClientDisconnection(cfg.Server.SenseClientDisconnection),
|
||||
server.WithStreamBody(true),
|
||||
server.WithIdleTimeout(30*time.Second),
|
||||
)
|
||||
r.AddProtocol("h2", factory.NewServerFactory())
|
||||
} else {
|
||||
|
|
@ -454,6 +457,7 @@ func main() {
|
|||
server.WithHostPorts(addr),
|
||||
server.WithSenseClientDisconnection(cfg.Server.SenseClientDisconnection),
|
||||
server.WithStreamBody(true),
|
||||
server.WithIdleTimeout(30*time.Second),
|
||||
)
|
||||
}
|
||||
} else {
|
||||
|
|
@ -462,6 +466,14 @@ func main() {
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
/*
|
||||
if cfg.Server.GoPoolSize > 0 {
|
||||
gopool.SetCap(int32(cfg.Server.GoPoolSize))
|
||||
} else {
|
||||
gopool.SetCap(1024)
|
||||
}
|
||||
*/
|
||||
|
||||
r.Use(recovery.Recovery()) // Recovery中间件
|
||||
r.Use(loggin.Middleware()) // log中间件
|
||||
r.Use(viaHeader())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue