outbound_connection.go 694 B

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