cloudflared_stub.go 732 B

1234567891011121314151617181920
  1. //go:build !with_cloudflared
  2. package include
  3. import (
  4. "context"
  5. "github.com/sagernet/sing-box/adapter"
  6. "github.com/sagernet/sing-box/adapter/inbound"
  7. C "github.com/sagernet/sing-box/constant"
  8. "github.com/sagernet/sing-box/log"
  9. "github.com/sagernet/sing-box/option"
  10. E "github.com/sagernet/sing/common/exceptions"
  11. )
  12. func registerCloudflaredInbound(registry *inbound.Registry) {
  13. inbound.Register[option.CloudflaredInboundOptions](registry, C.TypeCloudflared, func(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.CloudflaredInboundOptions) (adapter.Inbound, error) {
  14. return nil, E.New(`Cloudflared is not included in this build, rebuild with -tags with_cloudflared`)
  15. })
  16. }