proxy.go 726 B

12345678910111213141516171819202122
  1. // Package proxy contains all proxies used by V2Ray.
  2. package proxy
  3. import (
  4. v2net "github.com/v2ray/v2ray-core/common/net"
  5. "github.com/v2ray/v2ray-core/transport/ray"
  6. )
  7. // A InboundConnectionHandler handles inbound network connections to V2Ray.
  8. type InboundConnectionHandler interface {
  9. // Listen starts a InboundConnectionHandler by listen on a specific port.
  10. Listen(port v2net.Port) error
  11. // Close stops the handler to accepting anymore inbound connections.
  12. Close()
  13. }
  14. // An OutboundConnectionHandler handles outbound network connection for V2Ray.
  15. type OutboundConnectionHandler interface {
  16. // Dispatch sends one or more Packets to its destination.
  17. Dispatch(firstPacket v2net.Packet, ray ray.OutboundRay) error
  18. }