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