Files
sing-box/include/ocm_stub.go
2026-01-17 05:47:42 +08:00

21 lines
653 B
Go

//go:build !with_ocm
package include
import (
"context"
"github.com/sagernet/sing-box/adapter"
"github.com/sagernet/sing-box/adapter/service"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing-box/option"
E "github.com/sagernet/sing/common/exceptions"
)
func registerOCMService(registry *service.Registry) {
service.Register[option.OCMServiceOptions](registry, C.TypeOCM, func(ctx context.Context, logger log.ContextLogger, tag string, options option.OCMServiceOptions) (adapter.Service, error) {
return nil, E.New(`OCM is not included in this build, rebuild with -tags with_ocm`)
})
}