quic_stub.go 1017 B

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