summaryrefslogtreecommitdiff
path: root/service/http
diff options
context:
space:
mode:
Diffstat (limited to 'service/http')
-rw-r--r--service/http/config.go12
-rw-r--r--service/http/service.go4
2 files changed, 15 insertions, 1 deletions
diff --git a/service/http/config.go b/service/http/config.go
index 4b5950b3..caf94d98 100644
--- a/service/http/config.go
+++ b/service/http/config.go
@@ -18,6 +18,8 @@ type Config struct {
// SSL defines https server options.
SSL SSLConfig
+ HTTP2 *HTTP2Config
+
FCGI FCGIConfig
// MaxRequestSize specified max size for payload body in megabytes, set 0 to unlimited.
@@ -39,6 +41,10 @@ type FCGIConfig struct {
Address string
}
+type HTTP2Config struct {
+ MaxConcurrentStreams uint32
+}
+
// SSLConfig defines https server configuration.
type SSLConfig struct {
// Port to listen as HTTPS server, defaults to 443.
@@ -81,6 +87,12 @@ func (c *Config) Hydrate(cfg service.Config) error {
c.SSL.Port = 443
}
+ if c.HTTP2 == nil {
+ c.HTTP2 = &HTTP2Config{
+ MaxConcurrentStreams: 128,
+ }
+ }
+
c.Uploads.InitDefaults()
c.Workers.InitDefaults()
diff --git a/service/http/service.go b/service/http/service.go
index b309cd45..8e0d10ee 100644
--- a/service/http/service.go
+++ b/service/http/service.go
@@ -210,7 +210,9 @@ func (s *Service) initSSL() *http.Server {
s.throw(EventInitSSL, server)
// Enable HTTP/2 support by default
- http2.ConfigureServer(server, &http2.Server{})
+ http2.ConfigureServer(server, &http2.Server{
+ MaxConcurrentStreams: s.cfg.HTTP2.MaxConcurrentStreams,
+ })
return server
}