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

2
go.mod
View File

@ -7,7 +7,7 @@ require (
github.com/docker/libcontainer v2.2.1+incompatible
github.com/gin-contrib/cors v1.3.1
github.com/gin-gonic/gin v1.7.7
github.com/go-gost/core v0.0.0-20220413143512-acee88323487
github.com/go-gost/core v0.0.0-20220729131801-513eefe03499
github.com/go-gost/gosocks4 v0.0.1
github.com/go-gost/gosocks5 v0.3.1-0.20211109033403-d894d75b7f09
github.com/go-gost/relay v0.1.1-0.20211123134818-8ef7fd81ffd7

2
go.sum
View File

@ -123,6 +123,8 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gost/core v0.0.0-20220413143512-acee88323487 h1:boiBuK2m2jImLYkOlvey8bIrEl7TKM5ZbU+wNmX5oyg=
github.com/go-gost/core v0.0.0-20220413143512-acee88323487/go.mod h1:bHVbCS9da6XtKNYMkMUVcck5UqDDUkyC37erVfs4GXQ=
github.com/go-gost/core v0.0.0-20220729131801-513eefe03499 h1:6nBObAHksMleSd4MYG4cWYRL/nabXMrit65hX3zveB0=
github.com/go-gost/core v0.0.0-20220729131801-513eefe03499/go.mod h1:bHVbCS9da6XtKNYMkMUVcck5UqDDUkyC37erVfs4GXQ=
github.com/go-gost/gosocks4 v0.0.1 h1:+k1sec8HlELuQV7rWftIkmy8UijzUt2I6t+iMPlGB2s=
github.com/go-gost/gosocks4 v0.0.1/go.mod h1:3B6L47HbU/qugDg4JnoFPHgJXE43Inz8Bah1QaN9qCc=
github.com/go-gost/gosocks5 v0.3.1-0.20211109033403-d894d75b7f09 h1:A95M6UWcfZgOuJkQ7QLfG0Hs5peWIUSysCDNz4pfe04=

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)