diff options
author | Wolfy-J <[email protected]> | 2019-07-29 16:05:30 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2019-07-29 16:05:30 +0300 |
commit | 196d89d47056a58345ee50dee1af799c4e3ec847 (patch) | |
tree | a4b096d42ad517c9d18761a4780dd6b9f8b59224 /service/http/service.go | |
parent | 2879c62c3cbdcde328ecc9bacee1d6d8fbdec44a (diff) |
- added support for H2C by @Alex-Bond
Diffstat (limited to 'service/http/service.go')
-rw-r--r-- | service/http/service.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/service/http/service.go b/service/http/service.go index 845c4f1f..58038acb 100644 --- a/service/http/service.go +++ b/service/http/service.go @@ -100,10 +100,8 @@ func (s *Service) Serve() error { s.handler.Listen(s.throw) if s.cfg.EnableHTTP() { - var h2s *http2.Server - if s.cfg.EnableHTTP2() && !s.cfg.EnableTLS() { - h2s = &http2.Server{} - s.http = &http.Server{Addr: s.cfg.Address, Handler: h2c.NewHandler(s, h2s)} + if s.cfg.EnableH2C() { + s.http = &http.Server{Addr: s.cfg.Address, Handler: h2c.NewHandler(s, &http2.Server{})} } else { s.http = &http.Server{Addr: s.cfg.Address, Handler: s} } |