outbound.go 562 B

123456789101112131415161718192021222324
  1. package adapter
  2. import (
  3. "context"
  4. "github.com/sagernet/sing-box/log"
  5. "github.com/sagernet/sing-box/option"
  6. N "github.com/sagernet/sing/common/network"
  7. )
  8. // Note: for proxy protocols, outbound creates early connections by default.
  9. type Outbound interface {
  10. Type() string
  11. Tag() string
  12. Network() []string
  13. Dependencies() []string
  14. N.Dialer
  15. }
  16. type OutboundRegistry interface {
  17. option.OutboundOptionsRegistry
  18. CreateOutbound(ctx context.Context, router Router, logger log.ContextLogger, tag string, outboundType string, options any) (Outbound, error)
  19. }