[update] add plugin config (#1180)

Signed-off-by: lihaowei <haoweili35@gmail.com>
This commit is contained in:
Howie
2021-10-31 12:56:25 +08:00
committed by GitHub
parent 8230474667
commit cd1f8da13f
4 changed files with 58 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
package rest
import (
"crypto/tls"
"errors"
"fmt"
"net/http"
@@ -30,6 +31,7 @@ type engine struct {
middlewares []Middleware
shedder load.Shedder
priorityShedder load.Shedder
tlsConfig *tls.Config
}
func newEngine(c RestConf) *engine {
@@ -70,7 +72,7 @@ func (s *engine) StartWithRouter(router httpx.Router) error {
return internal.StartHttp(s.conf.Host, s.conf.Port, router)
}
return internal.StartHttps(s.conf.Host, s.conf.Port, s.conf.CertFile, s.conf.KeyFile, router)
return internal.StartHttps(s.conf.Host, s.conf.Port, s.conf.CertFile, s.conf.KeyFile, s.tlsConfig, router)
}
func (s *engine) appendAuthHandler(fr featuredRoutes, chain alice.Chain,