cmd/routed: alt-svc fix again
This commit is contained in:
parent
d63c627669
commit
7ea63913b9
|
@ -87,6 +87,8 @@ func setupQuic(s *Server, scfg Config) {
|
|||
},
|
||||
}
|
||||
|
||||
s.QuicServer = qs
|
||||
|
||||
for {
|
||||
ln.FatalErr(context.Background(), qs.ListenAndServe())
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package main
|
|||
import (
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
|
@ -13,6 +12,7 @@ import (
|
|||
"git.xeserv.us/xena/route/internal/tun2"
|
||||
proto "git.xeserv.us/xena/route/proto"
|
||||
"github.com/Xe/ln"
|
||||
"github.com/lucas-clemente/quic-go/h2quic"
|
||||
"github.com/mtneug/pkg/ulid"
|
||||
kcp "github.com/xtaci/kcp-go"
|
||||
"golang.org/x/crypto/acme/autocert"
|
||||
|
@ -32,6 +32,8 @@ type Server struct {
|
|||
db database.Storage
|
||||
ts *tun2.Server
|
||||
|
||||
QuicServer *h2quic.Server
|
||||
|
||||
*autocert.Manager
|
||||
}
|
||||
|
||||
|
@ -185,7 +187,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
rid := ulid.New().String()
|
||||
r.Header.Set("X-Request-Id", rid)
|
||||
w.Header().Set("X-Request-Id", rid)
|
||||
w.Header().Add("Alt-Svc", fmt.Sprintf(`hq="%s"; ma=2592000`, s.cfg.QuicAddr))
|
||||
s.QuicServer.SetQuicHeaders(w.Header())
|
||||
|
||||
// http://www.gnuterrypratchett.com/
|
||||
w.Header().Set("X-Clacks-Overhead", "GNU Ashlynn")
|
||||
|
|
Loading…
Reference in New Issue