2024-11-01 16:39:02 +00:00
|
|
|
//go:build !with_wireguard
|
|
|
|
|
|
|
|
package include
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/sagernet/sing-box/adapter"
|
2024-11-21 10:10:41 +00:00
|
|
|
"github.com/sagernet/sing-box/adapter/endpoint"
|
2024-11-01 16:39:02 +00:00
|
|
|
"github.com/sagernet/sing-box/adapter/outbound"
|
|
|
|
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 registerWireGuardOutbound(registry *outbound.Registry) {
|
2024-11-21 10:10:41 +00:00
|
|
|
outbound.Register[option.LegacyWireGuardOutboundOptions](registry, C.TypeWireGuard, func(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.LegacyWireGuardOutboundOptions) (adapter.Outbound, error) {
|
|
|
|
return nil, E.New(`WireGuard is not included in this build, rebuild with -tags with_wireguard`)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func registerWireGuardEndpoint(registry *endpoint.Registry) {
|
|
|
|
endpoint.Register[option.WireGuardEndpointOptions](registry, C.TypeWireGuard, func(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.WireGuardEndpointOptions) (adapter.Endpoint, error) {
|
2024-11-01 16:39:02 +00:00
|
|
|
return nil, E.New(`WireGuard is not included in this build, rebuild with -tags with_wireguard`)
|
|
|
|
})
|
|
|
|
}
|