quic_stub.go 1.1 KB

12345678910111213141516171819202122232425262728293031
  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. "github.com/sagernet/sing/common/logger"
  12. M "github.com/sagernet/sing/common/metadata"
  13. N "github.com/sagernet/sing/common/network"
  14. )
  15. func init() {
  16. dns.RegisterTransport([]string{"quic", "h3"}, func(options dns.TransportOptions) (dns.Transport, error) {
  17. return nil, C.ErrQUICNotIncluded
  18. })
  19. v2ray.RegisterQUICConstructor(
  20. func(ctx context.Context, logger logger.ContextLogger, options option.V2RayQUICOptions, tlsConfig tls.ServerConfig, handler adapter.V2RayServerTransportHandler) (adapter.V2RayServerTransport, error) {
  21. return nil, C.ErrQUICNotIncluded
  22. },
  23. func(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, options option.V2RayQUICOptions, tlsConfig tls.Config) (adapter.V2RayClientTransport, error) {
  24. return nil, C.ErrQUICNotIncluded
  25. },
  26. )
  27. }