Make connection limit configurable

This commit is contained in:
Harshavardhana
2015-06-06 14:22:51 -07:00
parent 6263b99e5a
commit 8b43655d9f
5 changed files with 82 additions and 48 deletions

14
main.go
View File

@@ -45,6 +45,11 @@ var flags = []cli.Flag{
Usage: "ADDRESS:PORT for management console access",
},
*/
cli.IntFlag{
Name: "conn-limit",
Value: 16,
Usage: "Set per IP connection limit quota for server: [DEFAULT: 16]",
},
cli.StringFlag{
Name: "cert",
Hide: true,
@@ -79,10 +84,11 @@ func getAPIServerConfig(c *cli.Context) httpserver.Config {
}
tls := (certFile != "" && keyFile != "")
return httpserver.Config{
Address: c.GlobalString("address"),
TLS: tls,
CertFile: certFile,
KeyFile: keyFile,
Address: c.GlobalString("address"),
TLS: tls,
CertFile: certFile,
KeyFile: keyFile,
ConnectionLimit: c.GlobalInt("conn-limit"),
}
}