mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-09-25 00:35:32 -05:00
NAS: Add read and idle timeouts
This commit is contained in:
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() {
|
||||
|
||||
Reference in New Issue
Block a user