command.proto 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. syntax = "proto3";
  2. package v2ray.core.app.router.command;
  3. option csharp_namespace = "V2Ray.Core.App.Router.Command";
  4. option go_package = "v2ray.com/core/app/router/command";
  5. option java_package = "com.v2ray.core.app.router.command";
  6. option java_multiple_files = true;
  7. import "common/net/network.proto";
  8. // RoutingContext is the context with information relative to routing process.
  9. // It conforms to the structure of v2ray.core.features.routing.Context and v2ray.core.features.routing.Route.
  10. message RoutingContext {
  11. string InboundTag = 1;
  12. v2ray.core.common.net.Network Network = 2;
  13. repeated bytes SourceIPs = 3;
  14. repeated bytes TargetIPs = 4;
  15. uint32 SourcePort = 5;
  16. uint32 TargetPort = 6;
  17. string TargetDomain = 7;
  18. string Protocol = 8;
  19. string User = 9;
  20. map<string, string> Attributes = 10;
  21. repeated string OutboundGroupTags = 11;
  22. string OutboundTag = 12;
  23. }
  24. // SubscribeRoutingStatsRequest subscribes to routing statistics channel if opened by v2ray-core.
  25. // * FieldSelectors selects a subset of fields in routing statistics to return. Valid selectors:
  26. // - inbound: Selects connection's inbound tag.
  27. // - network: Selects connection's network.
  28. // - ip: Equivalent as "ip_source" and "ip_target", selects both source and target IP.
  29. // - port: Equivalent as "port_source" and "port_target", selects both source and target port.
  30. // - domain: Selects target domain.
  31. // - protocol: Select connection's protocol.
  32. // - user: Select connection's inbound user email.
  33. // - attributes: Select connection's additional attributes.
  34. // - outbound: Equivalent as "outbound" and "outbound_group", select both outbound tag and outbound group tags.
  35. // * If FieldSelectors is left empty, all fields will be returned.
  36. message SubscribeRoutingStatsRequest {
  37. repeated string FieldSelectors = 1;
  38. }
  39. // TestRouteRequest manually tests a routing result according to the routing context message.
  40. // * RoutingContext is the routing message without outbound information.
  41. // * FieldSelectors selects the fields to return in the routing result. All fields are returned if left empty.
  42. // * PublishResult broadcasts the routing result to routing statistics channel if set true.
  43. message TestRouteRequest {
  44. RoutingContext RoutingContext = 1;
  45. repeated string FieldSelectors = 2;
  46. bool PublishResult = 3;
  47. }
  48. service RoutingService {
  49. rpc SubscribeRoutingStats(SubscribeRoutingStatsRequest) returns (stream RoutingContext) {}
  50. rpc TestRoute(TestRouteRequest) returns (RoutingContext) {}
  51. }
  52. message Config {}