outbound.go 451 B

123456789101112131415161718192021
  1. package adapter
  2. import (
  3. "context"
  4. "net"
  5. M "github.com/sagernet/sing/common/metadata"
  6. N "github.com/sagernet/sing/common/network"
  7. )
  8. type Outbound interface {
  9. Type() string
  10. Tag() string
  11. NewConnection(ctx context.Context, conn net.Conn, destination M.Socksaddr) error
  12. NewPacketConnection(ctx context.Context, conn N.PacketConn, destination M.Socksaddr) error
  13. N.Dialer
  14. }
  15. type OutboundInitializer interface {
  16. Init(outbound Outbound) error
  17. }