proxy.go 726 B

12345678910111213141516171819202122232425262728
  1. // Package proxy contains all proxies used by V2Ray.
  2. package proxy
  3. import (
  4. "context"
  5. "v2ray.com/core/app/dispatcher"
  6. "v2ray.com/core/common/net"
  7. "v2ray.com/core/transport/internet"
  8. "v2ray.com/core/transport/ray"
  9. )
  10. // An Inbound processes inbound connections.
  11. type Inbound interface {
  12. Network() net.NetworkList
  13. Process(context.Context, net.Network, internet.Connection, dispatcher.Interface) error
  14. }
  15. // An Outbound process outbound connections.
  16. type Outbound interface {
  17. Process(context.Context, ray.OutboundRay, Dialer) error
  18. }
  19. // Dialer is used by OutboundHandler for creating outbound connections.
  20. type Dialer interface {
  21. Dial(ctx context.Context, destination net.Destination) (internet.Connection, error)
  22. }