dispatcher.go 423 B

1234567891011121314151617181920
  1. package dispatcher
  2. import (
  3. "context"
  4. "v2ray.com/core/app"
  5. "v2ray.com/core/transport/ray"
  6. )
  7. // Interface dispatch a packet and possibly further network payload to its destination.
  8. type Interface interface {
  9. DispatchToOutbound(ctx context.Context) ray.InboundRay
  10. }
  11. func FromSpace(space app.Space) Interface {
  12. if app := space.GetApplication((*Interface)(nil)); app != nil {
  13. return app.(Interface)
  14. }
  15. return nil
  16. }