command.proto 2.5 KB

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