outbound.go 457 B

1234567891011121314151617181920
  1. package adapter
  2. import (
  3. "context"
  4. "net"
  5. N "github.com/sagernet/sing/common/network"
  6. )
  7. // Note: for proxy protocols, outbound creates early connections by default.
  8. type Outbound interface {
  9. Type() string
  10. Tag() string
  11. Network() []string
  12. Dependencies() []string
  13. N.Dialer
  14. NewConnection(ctx context.Context, conn net.Conn, metadata InboundContext) error
  15. NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata InboundContext) error
  16. }