github.com/inazumav/sing-box@v0.0.0-20230926072359-ab51429a14f1/include/quic_stub.go (about)

     1  //go:build !with_quic
     2  
     3  package include
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/inazumav/sing-box/adapter"
     9  	"github.com/inazumav/sing-box/common/tls"
    10  	C "github.com/inazumav/sing-box/constant"
    11  	"github.com/inazumav/sing-box/option"
    12  	"github.com/inazumav/sing-box/transport/v2ray"
    13  	"github.com/sagernet/sing-dns"
    14  	"github.com/sagernet/sing/common/logger"
    15  	M "github.com/sagernet/sing/common/metadata"
    16  	N "github.com/sagernet/sing/common/network"
    17  )
    18  
    19  const WithQUIC = false
    20  
    21  func init() {
    22  	dns.RegisterTransport([]string{"quic", "h3"}, func(name string, ctx context.Context, logger logger.ContextLogger, dialer N.Dialer, link string) (dns.Transport, error) {
    23  		return nil, C.ErrQUICNotIncluded
    24  	})
    25  	v2ray.RegisterQUICConstructor(
    26  		func(ctx context.Context, options option.V2RayQUICOptions, tlsConfig tls.ServerConfig, handler adapter.V2RayServerTransportHandler) (adapter.V2RayServerTransport, error) {
    27  			return nil, C.ErrQUICNotIncluded
    28  		},
    29  		func(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, options option.V2RayQUICOptions, tlsConfig tls.Config) (adapter.V2RayClientTransport, error) {
    30  			return nil, C.ErrQUICNotIncluded
    31  		},
    32  	)
    33  }