dispatcher.go 512 B

123456789101112131415161718
  1. package routing
  2. import (
  3. "context"
  4. "v2ray.com/core/common/net"
  5. "v2ray.com/core/common/vio"
  6. "v2ray.com/core/features"
  7. )
  8. // Dispatcher is a feature that dispatches inbound requests to outbound handlers based on rules.
  9. // Dispatcher is required to be registered in a V2Ray instance to make V2Ray function properly.
  10. type Dispatcher interface {
  11. features.Feature
  12. // Dispatch returns a Ray for transporting data for the given request.
  13. Dispatch(ctx context.Context, dest net.Destination) (*vio.Link, error)
  14. }