aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Crute <mike@crute.us>2023-10-08 20:53:49 -0700
committerMike Crute <mike@crute.us>2023-10-08 20:53:49 -0700
commit1b46d6ed49f2b3213c6d90dca5ba8046f8972c60 (patch)
treef5f52241fc47f809521a2b5484c338cc6d45a628
parent32b978a2b96065bbac5ef3da5969abd68d866733 (diff)
downloadgolib-1b46d6ed49f2b3213c6d90dca5ba8046f8972c60.tar.bz2
golib-1b46d6ed49f2b3213c6d90dca5ba8046f8972c60.tar.xz
golib-1b46d6ed49f2b3213c6d90dca5ba8046f8972c60.zip
echo: allow disabling HTTP3echo/v0.14.1
-rw-r--r--echo/echo_default.go23
1 files changed, 13 insertions, 10 deletions
diff --git a/echo/echo_default.go b/echo/echo_default.go
index 9f7e19e..b24779b 100644
--- a/echo/echo_default.go
+++ b/echo/echo_default.go
@@ -66,6 +66,7 @@ type EchoConfig struct {
66 RedirectToWWW bool 66 RedirectToWWW bool
67 ContentSecurityPolicy *glmw.ContentSecurityPolicyConfig 67 ContentSecurityPolicy *glmw.ContentSecurityPolicyConfig
68 DisablePrometheus bool 68 DisablePrometheus bool
69 DisableHttp3 bool
69 PrometheusConfig *prometheus.PrometheusConfig 70 PrometheusConfig *prometheus.PrometheusConfig
70 CORSConfig *middleware.CORSConfig 71 CORSConfig *middleware.CORSConfig
71} 72}
@@ -304,17 +305,19 @@ func (w *EchoWrapper) buildServers(c *EchoConfig) {
304 w.runner.AddJob(w.makeServerJob(&netHttpWrapper{s})) 305 w.runner.AddJob(w.makeServerJob(&netHttpWrapper{s}))
305 } 306 }
306 307
307 for _, a := range w.AddressPortConfig.QuicBindings() { 308 if !c.DisableHttp3 {
308 q := &http3.Server{ 309 for _, a := range w.AddressPortConfig.QuicBindings() {
309 Addr: a, 310 q := &http3.Server{
310 TLSConfig: http3.ConfigureTLSConfig(&tls.Config{ 311 Addr: a,
311 MinVersion: tls.VersionTLS13, 312 TLSConfig: http3.ConfigureTLSConfig(&tls.Config{
312 GetCertificate: c.Autocert.GetCertificate, 313 MinVersion: tls.VersionTLS13,
313 }), 314 GetCertificate: c.Autocert.GetCertificate,
314 Handler: w, 315 }),
316 Handler: w,
317 }
318 w.runner.AddJob(w.makeServerJob(&http3Wrapper{q}))
319 w.Use(glmw.Http3AltSvcMiddleware(w.AddressPortConfig.QuicPort))
315 } 320 }
316 w.runner.AddJob(w.makeServerJob(&http3Wrapper{q}))
317 w.Use(glmw.Http3AltSvcMiddleware(w.AddressPortConfig.QuicPort))
318 } 321 }
319} 322}
320 323