proxy.go 663 B

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