mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-04-19 07:47:29 -05:00
NAS: Add read and idle timeouts
This commit is contained in:
parent
5dfb1eeda7
commit
c6927a3cb6
17
nas/https.go
17
nas/https.go
|
|
@ -83,9 +83,11 @@ func startHTTPSProxy(config common.Config) {
|
|||
panic(err)
|
||||
}
|
||||
|
||||
moduleName := "NAS-TLS:" + conn.RemoteAddr().String()
|
||||
|
||||
go func() {
|
||||
moduleName := "NAS-TLS:" + conn.RemoteAddr().String()
|
||||
|
||||
conn.SetReadDeadline(time.Now().Add(5 * time.Second))
|
||||
|
||||
handleRealTLS(moduleName, conn, nasAddr, privKeyPath, certsPath)
|
||||
}()
|
||||
}
|
||||
|
|
@ -234,10 +236,15 @@ func startHTTPSProxy(config common.Config) {
|
|||
panic(err)
|
||||
}
|
||||
|
||||
// logging.Info("NAS-TLS", "Receiving HTTPS request from", aurora.BrightCyan(conn.RemoteAddr()))
|
||||
moduleName := "NAS-TLS:" + conn.RemoteAddr().String()
|
||||
go func() {
|
||||
// logging.Info("NAS-TLS", "Receiving HTTPS request from", aurora.BrightCyan(conn.RemoteAddr()))
|
||||
|
||||
go handleTLS(moduleName, conn, nasAddr, privKeyPath, certsPath, serverCertsRecordWii, rsaKeyWii, serverCertsRecordDS, rsaKeyDS)
|
||||
moduleName := "NAS-TLS:" + conn.RemoteAddr().String()
|
||||
|
||||
conn.SetReadDeadline(time.Now().Add(5 * time.Second))
|
||||
|
||||
handleTLS(moduleName, conn, nasAddr, privKeyPath, certsPath, serverCertsRecordWii, rsaKeyWii, serverCertsRecordDS, rsaKeyDS)
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,8 +41,10 @@ func StartServer(reload bool) {
|
|||
}
|
||||
|
||||
server = &nhttp.Server{
|
||||
Addr: address,
|
||||
Handler: http.HandlerFunc(handleRequest),
|
||||
Addr: address,
|
||||
Handler: http.HandlerFunc(handleRequest),
|
||||
IdleTimeout: 20 * time.Second,
|
||||
ReadTimeout: 10 * time.Second,
|
||||
}
|
||||
|
||||
go func() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user