pull/314/head
Darien Raymond 8 years ago
parent 9bd8822668
commit b81d091fb8
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

@ -5,7 +5,10 @@ option go_package = "loader";
option java_package = "com.v2ray.core.common.loader"; option java_package = "com.v2ray.core.common.loader";
option java_outer_classname = "TypeProto"; option java_outer_classname = "TypeProto";
// Serialized proto message along with its type name.
message TypedSettings { message TypedSettings {
// The name of the message type, retrieved from protobuf API.
string type = 1; string type = 1;
// Serialized proto message.
bytes settings = 2; bytes settings = 2;
} }

@ -12,6 +12,7 @@ import "v2ray.com/core/common/log/config.proto";
import "v2ray.com/core/transport/internet/config.proto"; import "v2ray.com/core/transport/internet/config.proto";
import "v2ray.com/core/transport/config.proto"; import "v2ray.com/core/transport/config.proto";
// Configuration serialization format.
enum ConfigFormat { enum ConfigFormat {
Protobuf = 0; Protobuf = 0;
JSON = 1; JSON = 1;
@ -40,34 +41,54 @@ message AllocationStrategy {
Type type = 1; Type type = 1;
// Number of handlers (ports) running in parallel. // Number of handlers (ports) running in parallel.
// Default value is 3 if unset.
AllocationStrategyConcurrency concurrency = 2; AllocationStrategyConcurrency concurrency = 2;
// Number of minutes before a handler is regenerated. // Number of minutes before a handler is regenerated.
// Default value is 5 if unset.
AllocationStrategyRefresh refresh = 3; AllocationStrategyRefresh refresh = 3;
} }
// Config for an inbound connection handler. // Config for an inbound connection handler.
message InboundConnectionConfig { message InboundConnectionConfig {
// Protocol specific settings. Must be one of the supported protocols.
v2ray.core.common.loader.TypedSettings settings = 1; v2ray.core.common.loader.TypedSettings settings = 1;
// Range of port number to run on. Both inclusive.
v2ray.core.common.net.PortRange port_range = 2; 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; v2ray.core.common.net.IPOrDomain listen_on = 3;
// Tag of this handler.
string tag = 4; string tag = 4;
AllocationStrategy allocation_strategy = 5; AllocationStrategy allocation_strategy = 5;
v2ray.core.transport.internet.StreamConfig stream_settings = 6; v2ray.core.transport.internet.StreamConfig stream_settings = 6;
bool allow_passive_connection = 7; bool allow_passive_connection = 7;
} }
// Config for an outbound connection handler.
message OutboundConnectionConfig { message OutboundConnectionConfig {
v2ray.core.common.loader.TypedSettings settings = 1; 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.common.net.IPOrDomain send_through = 2;
v2ray.core.transport.internet.StreamConfig stream_settings = 3; v2ray.core.transport.internet.StreamConfig stream_settings = 3;
string tag = 4; string tag = 4;
} }
message Config { message Config {
// Inbound handler configurations. Must have at least one item.
repeated InboundConnectionConfig inbound = 1; 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; repeated OutboundConnectionConfig outbound = 2;
v2ray.core.common.log.Config log = 3; v2ray.core.common.log.Config log = 3;
// App configuration. Must be one in the app directory.
repeated v2ray.core.common.loader.TypedSettings app = 4; repeated v2ray.core.common.loader.TypedSettings app = 4;
v2ray.core.transport.Config transport = 5; v2ray.core.transport.Config transport = 5;
} }

@ -8,13 +8,21 @@ import "v2ray.com/core/common/net/network.proto";
import "v2ray.com/core/common/loader/type.proto"; import "v2ray.com/core/common/loader/type.proto";
message NetworkSettings { message NetworkSettings {
// Type of network that this settings supports.
v2ray.core.common.net.Network network = 1; v2ray.core.common.net.Network network = 1;
// Specific settings.
v2ray.core.common.loader.TypedSettings settings = 2; v2ray.core.common.loader.TypedSettings settings = 2;
} }
message StreamConfig { message StreamConfig {
// Effective network.
v2ray.core.common.net.Network network = 1; v2ray.core.common.net.Network network = 1;
repeated NetworkSettings network_settings = 2; repeated NetworkSettings network_settings = 2;
// Type of security. Must be a message name of the settings proto.
string security_type = 3; string security_type = 3;
repeated v2ray.core.common.loader.TypedSettings security_settings = 4; repeated v2ray.core.common.loader.TypedSettings security_settings = 4;
} }
Loading…
Cancel
Save