mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
225 lines
9.2 KiB
225 lines
9.2 KiB
package core
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
import v2ray_core_common_serial "v2ray.com/core/common/serial"
|
|
import v2ray_core_transport "v2ray.com/core/transport"
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
// Configuration serialization format.
|
|
type ConfigFormat int32
|
|
|
|
const (
|
|
ConfigFormat_Protobuf ConfigFormat = 0
|
|
ConfigFormat_JSON ConfigFormat = 1
|
|
)
|
|
|
|
var ConfigFormat_name = map[int32]string{
|
|
0: "Protobuf",
|
|
1: "JSON",
|
|
}
|
|
var ConfigFormat_value = map[string]int32{
|
|
"Protobuf": 0,
|
|
"JSON": 1,
|
|
}
|
|
|
|
func (x ConfigFormat) String() string {
|
|
return proto.EnumName(ConfigFormat_name, int32(x))
|
|
}
|
|
func (ConfigFormat) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
|
|
|
// Master config of V2Ray. V2Ray takes this config as input and functions accordingly.
|
|
type Config struct {
|
|
// Inbound handler configurations. Must have at least one item.
|
|
Inbound []*InboundHandlerConfig `protobuf:"bytes,1,rep,name=inbound" json:"inbound,omitempty"`
|
|
// Outbound handler configurations. Must have at least one item. The first item is used as default for routing.
|
|
Outbound []*OutboundHandlerConfig `protobuf:"bytes,2,rep,name=outbound" json:"outbound,omitempty"`
|
|
// App configuration. Must be one in the app directory.
|
|
App []*v2ray_core_common_serial.TypedMessage `protobuf:"bytes,4,rep,name=app" json:"app,omitempty"`
|
|
// Transport settings.
|
|
Transport *v2ray_core_transport.Config `protobuf:"bytes,5,opt,name=transport" json:"transport,omitempty"`
|
|
// Configuration for extensions. The config may not work if corresponding extension is not loaded into V2Ray.
|
|
// V2Ray will ignore such config during initialization.
|
|
Extension []*v2ray_core_common_serial.TypedMessage `protobuf:"bytes,6,rep,name=extension" json:"extension,omitempty"`
|
|
}
|
|
|
|
func (m *Config) Reset() { *m = Config{} }
|
|
func (m *Config) String() string { return proto.CompactTextString(m) }
|
|
func (*Config) ProtoMessage() {}
|
|
func (*Config) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
|
|
|
func (m *Config) GetInbound() []*InboundHandlerConfig {
|
|
if m != nil {
|
|
return m.Inbound
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Config) GetOutbound() []*OutboundHandlerConfig {
|
|
if m != nil {
|
|
return m.Outbound
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Config) GetApp() []*v2ray_core_common_serial.TypedMessage {
|
|
if m != nil {
|
|
return m.App
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Config) GetTransport() *v2ray_core_transport.Config {
|
|
if m != nil {
|
|
return m.Transport
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Config) GetExtension() []*v2ray_core_common_serial.TypedMessage {
|
|
if m != nil {
|
|
return m.Extension
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type InboundHandlerConfig struct {
|
|
// Tag of the inbound handler.
|
|
Tag string `protobuf:"bytes,1,opt,name=tag" json:"tag,omitempty"`
|
|
// Settings for how this inbound proxy is handled. Must be ReceiverConfig above.
|
|
ReceiverSettings *v2ray_core_common_serial.TypedMessage `protobuf:"bytes,2,opt,name=receiver_settings,json=receiverSettings" json:"receiver_settings,omitempty"`
|
|
// Settings for inbound proxy. Must be one of the inbound proxies.
|
|
ProxySettings *v2ray_core_common_serial.TypedMessage `protobuf:"bytes,3,opt,name=proxy_settings,json=proxySettings" json:"proxy_settings,omitempty"`
|
|
}
|
|
|
|
func (m *InboundHandlerConfig) Reset() { *m = InboundHandlerConfig{} }
|
|
func (m *InboundHandlerConfig) String() string { return proto.CompactTextString(m) }
|
|
func (*InboundHandlerConfig) ProtoMessage() {}
|
|
func (*InboundHandlerConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
|
|
|
func (m *InboundHandlerConfig) GetTag() string {
|
|
if m != nil {
|
|
return m.Tag
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *InboundHandlerConfig) GetReceiverSettings() *v2ray_core_common_serial.TypedMessage {
|
|
if m != nil {
|
|
return m.ReceiverSettings
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *InboundHandlerConfig) GetProxySettings() *v2ray_core_common_serial.TypedMessage {
|
|
if m != nil {
|
|
return m.ProxySettings
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type OutboundHandlerConfig struct {
|
|
// Tag of this outbound handler.
|
|
Tag string `protobuf:"bytes,1,opt,name=tag" json:"tag,omitempty"`
|
|
// Settings for how to dial connection for this outbound handler. Must be SenderConfig above.
|
|
SenderSettings *v2ray_core_common_serial.TypedMessage `protobuf:"bytes,2,opt,name=sender_settings,json=senderSettings" json:"sender_settings,omitempty"`
|
|
// Settings for this outbound proxy. Must be one of the outbound proxies.
|
|
ProxySettings *v2ray_core_common_serial.TypedMessage `protobuf:"bytes,3,opt,name=proxy_settings,json=proxySettings" json:"proxy_settings,omitempty"`
|
|
// If not zero, this outbound will be expired in seconds. Not used for now.
|
|
Expire int64 `protobuf:"varint,4,opt,name=expire" json:"expire,omitempty"`
|
|
// Comment of this outbound handler. Not used for now.
|
|
Comment string `protobuf:"bytes,5,opt,name=comment" json:"comment,omitempty"`
|
|
}
|
|
|
|
func (m *OutboundHandlerConfig) Reset() { *m = OutboundHandlerConfig{} }
|
|
func (m *OutboundHandlerConfig) String() string { return proto.CompactTextString(m) }
|
|
func (*OutboundHandlerConfig) ProtoMessage() {}
|
|
func (*OutboundHandlerConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
|
|
|
|
func (m *OutboundHandlerConfig) GetTag() string {
|
|
if m != nil {
|
|
return m.Tag
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *OutboundHandlerConfig) GetSenderSettings() *v2ray_core_common_serial.TypedMessage {
|
|
if m != nil {
|
|
return m.SenderSettings
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *OutboundHandlerConfig) GetProxySettings() *v2ray_core_common_serial.TypedMessage {
|
|
if m != nil {
|
|
return m.ProxySettings
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *OutboundHandlerConfig) GetExpire() int64 {
|
|
if m != nil {
|
|
return m.Expire
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *OutboundHandlerConfig) GetComment() string {
|
|
if m != nil {
|
|
return m.Comment
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*Config)(nil), "v2ray.core.Config")
|
|
proto.RegisterType((*InboundHandlerConfig)(nil), "v2ray.core.InboundHandlerConfig")
|
|
proto.RegisterType((*OutboundHandlerConfig)(nil), "v2ray.core.OutboundHandlerConfig")
|
|
proto.RegisterEnum("v2ray.core.ConfigFormat", ConfigFormat_name, ConfigFormat_value)
|
|
}
|
|
|
|
func init() { proto.RegisterFile("v2ray.com/core/config.proto", fileDescriptor0) }
|
|
|
|
var fileDescriptor0 = []byte{
|
|
// 436 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0x41, 0x6f, 0xd3, 0x30,
|
|
0x14, 0xc7, 0x71, 0x13, 0xba, 0xf6, 0x6d, 0x94, 0x60, 0x01, 0xb2, 0x06, 0x87, 0x50, 0x69, 0x53,
|
|
0xc5, 0xc1, 0x45, 0xe5, 0x82, 0x26, 0x71, 0x61, 0x08, 0xc1, 0xa4, 0xd1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