forked from v2ray/v2ray-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.proto
95 lines (72 loc) · 2.64 KB
/
config.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
syntax = "proto3";
package v2ray.core;
option go_package = "core";
option java_package = "com.v2ray.core";
option java_outer_classname = "ConfigProto";
import "v2ray.com/core/common/loader/type.proto";
import "v2ray.com/core/common/net/port.proto";
import "v2ray.com/core/common/net/address.proto";
import "v2ray.com/core/common/log/config.proto";
import "v2ray.com/core/transport/internet/config.proto";
import "v2ray.com/core/transport/config.proto";
// Configuration serialization format.
enum ConfigFormat {
Protobuf = 0;
JSON = 1;
}
message AllocationStrategyConcurrency {
uint32 value = 1;
}
message AllocationStrategyRefresh {
uint32 value = 1;
}
message AllocationStrategy {
enum Type {
// Always allocate all connection handlers.
Always = 0;
// Randomly allocate specific range of handlers.
Random = 1;
// External. Not supported yet.
External = 2;
}
Type type = 1;
// Number of handlers (ports) running in parallel.
// Default value is 3 if unset.
AllocationStrategyConcurrency concurrency = 2;
// Number of minutes before a handler is regenerated.
// Default value is 5 if unset.
AllocationStrategyRefresh refresh = 3;
}
// Config for an inbound connection handler.
message InboundConnectionConfig {
// Protocol specific settings. Must be one of the supported protocols.
v2ray.core.common.loader.TypedSettings settings = 1;
// Range of port number to run on. Both inclusive.
v2ray.core.common.net.PortRange port_range = 2;
// IP address to listen on. 0.0.0.0 if unset.
v2ray.core.common.net.IPOrDomain listen_on = 3;
// Tag of this handler.
string tag = 4;
AllocationStrategy allocation_strategy = 5;
v2ray.core.transport.internet.StreamConfig stream_settings = 6;
bool allow_passive_connection = 7;
}
// Config for an outbound connection handler.
message OutboundConnectionConfig {
v2ray.core.common.loader.TypedSettings settings = 1;
// IP address to send data through. 0.0.0.0 if unset.
v2ray.core.common.net.IPOrDomain send_through = 2;
v2ray.core.transport.internet.StreamConfig stream_settings = 3;
v2ray.core.transport.internet.ProxyConfig proxy_settings = 5;
string tag = 4;
}
message Config {
// Inbound handler configurations. Must have at least one item.
repeated InboundConnectionConfig inbound = 1;
// Outbound handler configurations. Must have at least one item. The first item is used as default for routing.
repeated OutboundConnectionConfig outbound = 2;
v2ray.core.common.log.Config log = 3;
// App configuration. Must be one in the app directory.
repeated v2ray.core.common.loader.TypedSettings app = 4;
v2ray.core.transport.Config transport = 5;
}