fix crash when starting http3 server

This commit is contained in:
ginuerzh
2022-07-29 21:19:41 +08:00
parent 818463260f
commit 90453838a1
3 changed files with 4 additions and 2 deletions

View File

@ -145,7 +145,7 @@ func NewHTTP3Server(addr string, quicConfig *quic.Config, opts ...ServerOption)
func (s *Server) ListenAndServe() error {
if s.http3Server != nil {
network := "udp"
if xnet.IsIPv4(s.httpServer.Addr) {
if xnet.IsIPv4(s.http3Server.Addr) {
network = "udp4"
}
addr, err := net.ResolveUDPAddr(network, s.http3Server.Addr)