outbound_connection.go 636 B

123456789101112131415161718
  1. package proxy
  2. import (
  3. v2net "github.com/v2ray/v2ray-core/common/net"
  4. "github.com/v2ray/v2ray-core/transport/ray"
  5. )
  6. // An OutboundConnectionHandlerFactory creates OutboundConnectionHandler on demand.
  7. type OutboundConnectionHandlerFactory interface {
  8. // Create creates a new OutboundConnectionHandler with given config.
  9. Create(config interface{}) (OutboundConnectionHandler, error)
  10. }
  11. // An OutboundConnectionHandler handles outbound network connection for V2Ray.
  12. type OutboundConnectionHandler interface {
  13. // Dispatch sends one or more Packets to its destination.
  14. Dispatch(firstPacket v2net.Packet, ray ray.OutboundRay) error
  15. }