config.proto 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. syntax = "proto3";
  2. package xray.app.policy;
  3. option csharp_namespace = "Xray.App.Policy";
  4. option go_package = "github.com/xtls/xray-core/app/policy";
  5. option java_package = "com.xray.app.policy";
  6. option java_multiple_files = true;
  7. message Second {
  8. uint32 value = 1;
  9. }
  10. message Policy {
  11. // Timeout is a message for timeout settings in various stages, in seconds.
  12. message Timeout {
  13. Second handshake = 1;
  14. Second connection_idle = 2;
  15. Second uplink_only = 3;
  16. Second downlink_only = 4;
  17. }
  18. message Stats {
  19. bool user_uplink = 1;
  20. bool user_downlink = 2;
  21. bool user_online = 3;
  22. }
  23. message Buffer {
  24. // Buffer size per connection, in bytes. -1 for unlimited buffer.
  25. int32 connection = 1;
  26. }
  27. Timeout timeout = 1;
  28. Stats stats = 2;
  29. Buffer buffer = 3;
  30. }
  31. message SystemPolicy {
  32. message Stats {
  33. bool inbound_uplink = 1;
  34. bool inbound_downlink = 2;
  35. bool outbound_uplink = 3;
  36. bool outbound_downlink = 4;
  37. }
  38. Stats stats = 1;
  39. }
  40. message Config {
  41. map<uint32, Policy> level = 1;
  42. SystemPolicy system = 2;
  43. }