mirror of
https://github.com/kataras/iris.git
synced 2026-01-17 00:45:55 +00:00
New iris.WithKeepAlive(time.Duration) Configurator is added as a helper to enable TCP listener featured with keep-alive
This commit is contained in:
@@ -26,6 +26,8 @@ func newApp() *iris.Application {
|
||||
Compress: false,
|
||||
// List the files inside the current requested directory if `IndexName` not found.
|
||||
ShowList: false,
|
||||
// When ShowList is true you can configure if you want to show or hide hidden files.
|
||||
ShowHidden: false,
|
||||
Cache: iris.DirCacheOptions{
|
||||
// enable in-memory cache and pre-compress the files.
|
||||
Enable: true,
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/kataras/iris/v12"
|
||||
)
|
||||
import "github.com/kataras/iris/v12"
|
||||
|
||||
func main() {
|
||||
app := iris.New()
|
||||
@@ -13,5 +11,9 @@ func main() {
|
||||
|
||||
// http://localhost:8080
|
||||
// Identical to: app.Run(iris.Addr(":8080"))
|
||||
|
||||
app.Listen(":8080")
|
||||
// To listen using keep alive tcp connection listener,
|
||||
// set the KeepAlive duration configuration instead:
|
||||
// app.Listen(":8080", iris.WithKeepAlive(3*time.Minute))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user