proxy.go 702 B

123456789101112131415161718192021
  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. This method is called
  10. // exactly once during runtime.
  11. Listen(port v2net.Port) error
  12. }
  13. // An OutboundConnectionHandler handles outbound network connection for V2Ray.
  14. type OutboundConnectionHandler interface {
  15. // Dispatch sends one or more Packets to its destination.
  16. Dispatch(firstPacket v2net.Packet, ray ray.OutboundRay) error
  17. }