Documentation ¶
Overview ¶
Package core is a generated protocol buffer package.
It is generated from these files:
v2ray.com/core/config.proto
It has these top-level messages:
AllocationStrategyConcurrency AllocationStrategyRefresh AllocationStrategy InboundConnectionConfig OutboundConnectionConfig Config
Package core provides common definitions and functionalities of V2Ray.
Index ¶
- Variables
- func PrintVersion()
- func RegisterConfigLoader(format ConfigFormat, loader ConfigLoader) error
- func Version() string
- type AllocationStrategy
- func (*AllocationStrategy) Descriptor() ([]byte, []int)
- func (m *AllocationStrategy) GetConcurrency() *AllocationStrategyConcurrency
- func (m *AllocationStrategy) GetRefresh() *AllocationStrategyRefresh
- func (*AllocationStrategy) ProtoMessage()
- func (m *AllocationStrategy) Reset()
- func (m *AllocationStrategy) String() string
- type AllocationStrategyConcurrency
- type AllocationStrategyRefresh
- type AllocationStrategy_Type
- type Config
- func (*Config) Descriptor() ([]byte, []int)
- func (m *Config) GetApp() []*v2ray_core_common_loader.TypedSettings
- func (m *Config) GetInbound() []*InboundConnectionConfig
- func (m *Config) GetLog() *v2ray_core_common_log.Config
- func (m *Config) GetOutbound() []*OutboundConnectionConfig
- func (m *Config) GetTransport() *v2ray_core_transport.Config
- func (*Config) ProtoMessage()
- func (m *Config) Reset()
- func (m *Config) String() string
- type ConfigFormat
- type ConfigLoader
- type InboundConnectionConfig
- func (*InboundConnectionConfig) Descriptor() ([]byte, []int)
- func (m *InboundConnectionConfig) GetAllocationStrategy() *AllocationStrategy
- func (this *InboundConnectionConfig) GetAllocationStrategyValue() *AllocationStrategy
- func (m *InboundConnectionConfig) GetListenOn() *v2ray_core_common_net1.IPOrDomain
- func (this *InboundConnectionConfig) GetListenOnValue() v2net.Address
- func (m *InboundConnectionConfig) GetPortRange() *v2ray_core_common_net.PortRange
- func (m *InboundConnectionConfig) GetSettings() *v2ray_core_common_loader.TypedSettings
- func (m *InboundConnectionConfig) GetStreamSettings() *v2ray_core_transport_internet.StreamConfig
- func (this *InboundConnectionConfig) GetTypedSettings() (interface{}, error)
- func (*InboundConnectionConfig) ProtoMessage()
- func (m *InboundConnectionConfig) Reset()
- func (m *InboundConnectionConfig) String() string
- type InboundDetourHandler
- type InboundDetourHandlerAlways
- type InboundDetourHandlerDynamic
- type OutboundConnectionConfig
- func (*OutboundConnectionConfig) Descriptor() ([]byte, []int)
- func (m *OutboundConnectionConfig) GetSendThrough() *v2ray_core_common_net1.IPOrDomain
- func (this *OutboundConnectionConfig) GetSendThroughValue() v2net.Address
- func (m *OutboundConnectionConfig) GetSettings() *v2ray_core_common_loader.TypedSettings
- func (m *OutboundConnectionConfig) GetStreamSettings() *v2ray_core_transport_internet.StreamConfig
- func (this *OutboundConnectionConfig) GetTypedSettings() (interface{}, error)
- func (*OutboundConnectionConfig) ProtoMessage()
- func (m *OutboundConnectionConfig) Reset()
- func (m *OutboundConnectionConfig) String() string
- type Point
Constants ¶
This section is empty.
Variables ¶
View Source
var AllocationStrategy_Type_name = map[int32]string{
0: "Always",
1: "Random",
2: "External",
}
View Source
var AllocationStrategy_Type_value = map[string]int32{
"Always": 0,
"Random": 1,
"External": 2,
}
View Source
var ConfigFormat_name = map[int32]string{
0: "Protobuf",
1: "JSON",
}
View Source
var ConfigFormat_value = map[string]int32{
"Protobuf": 0,
"JSON": 1,
}
Functions ¶
func PrintVersion ¶ added in v0.9.1
func PrintVersion()
func RegisterConfigLoader ¶
func RegisterConfigLoader(format ConfigFormat, loader ConfigLoader) error
Types ¶
type AllocationStrategy ¶
type AllocationStrategy struct { Type AllocationStrategy_Type `protobuf:"varint,1,opt,name=type,enum=v2ray.core.AllocationStrategy_Type" json:"type,omitempty"` // Number of handlers (ports) running in parallel. // Default value is 3 if unset. Concurrency *AllocationStrategyConcurrency `protobuf:"bytes,2,opt,name=concurrency" json:"concurrency,omitempty"` // Number of minutes before a handler is regenerated. // Default value is 5 if unset. Refresh *AllocationStrategyRefresh `protobuf:"bytes,3,opt,name=refresh" json:"refresh,omitempty"` }
func (*AllocationStrategy) Descriptor ¶
func (*AllocationStrategy) Descriptor() ([]byte, []int)
func (*AllocationStrategy) GetConcurrency ¶
func (m *AllocationStrategy) GetConcurrency() *AllocationStrategyConcurrency
func (*AllocationStrategy) GetRefresh ¶
func (m *AllocationStrategy) GetRefresh() *AllocationStrategyRefresh
func (*AllocationStrategy) ProtoMessage ¶
func (*AllocationStrategy) ProtoMessage()
func (*AllocationStrategy) Reset ¶
func (m *AllocationStrategy) Reset()
func (*AllocationStrategy) String ¶
func (m *AllocationStrategy) String() string
type AllocationStrategyConcurrency ¶
type AllocationStrategyConcurrency struct {
Value uint32 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
}
func (*AllocationStrategyConcurrency) Descriptor ¶
func (*AllocationStrategyConcurrency) Descriptor() ([]byte, []int)
func (*AllocationStrategyConcurrency) GetValue ¶
func (this *AllocationStrategyConcurrency) GetValue() uint32
func (*AllocationStrategyConcurrency) ProtoMessage ¶
func (*AllocationStrategyConcurrency) ProtoMessage()
func (*AllocationStrategyConcurrency) Reset ¶
func (m *AllocationStrategyConcurrency) Reset()
func (*AllocationStrategyConcurrency) String ¶
func (m *AllocationStrategyConcurrency) String() string
type AllocationStrategyRefresh ¶
type AllocationStrategyRefresh struct {
Value uint32 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
}
func (*AllocationStrategyRefresh) Descriptor ¶
func (*AllocationStrategyRefresh) Descriptor() ([]byte, []int)
func (*AllocationStrategyRefresh) GetValue ¶
func (this *AllocationStrategyRefresh) GetValue() uint32
func (*AllocationStrategyRefresh) ProtoMessage ¶
func (*AllocationStrategyRefresh) ProtoMessage()
func (*AllocationStrategyRefresh) Reset ¶
func (m *AllocationStrategyRefresh) Reset()
func (*AllocationStrategyRefresh) String ¶
func (m *AllocationStrategyRefresh) String() string
type AllocationStrategy_Type ¶
type AllocationStrategy_Type int32
const ( // Always allocate all connection handlers. AllocationStrategy_Always AllocationStrategy_Type = 0 // Randomly allocate specific range of handlers. AllocationStrategy_Random AllocationStrategy_Type = 1 // External. Not supported yet. AllocationStrategy_External AllocationStrategy_Type = 2 )
func (AllocationStrategy_Type) EnumDescriptor ¶
func (AllocationStrategy_Type) EnumDescriptor() ([]byte, []int)
func (AllocationStrategy_Type) String ¶
func (x AllocationStrategy_Type) String() string
type Config ¶
type Config struct { // Inbound handler configurations. Must have at least one item. Inbound []*InboundConnectionConfig `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 []*OutboundConnectionConfig `protobuf:"bytes,2,rep,name=outbound" json:"outbound,omitempty"` Log *v2ray_core_common_log.Config `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` // App configuration. Must be one in the app directory. App []*v2ray_core_common_loader.TypedSettings `protobuf:"bytes,4,rep,name=app" json:"app,omitempty"` Transport *v2ray_core_transport.Config `protobuf:"bytes,5,opt,name=transport" json:"transport,omitempty"` }
func LoadConfig ¶
func LoadConfig(format ConfigFormat, input io.Reader) (*Config, error)
func (*Config) Descriptor ¶
func (*Config) GetApp ¶
func (m *Config) GetApp() []*v2ray_core_common_loader.TypedSettings
func (*Config) GetInbound ¶
func (m *Config) GetInbound() []*InboundConnectionConfig
func (*Config) GetLog ¶
func (m *Config) GetLog() *v2ray_core_common_log.Config
func (*Config) GetOutbound ¶
func (m *Config) GetOutbound() []*OutboundConnectionConfig
func (*Config) GetTransport ¶
func (m *Config) GetTransport() *v2ray_core_transport.Config
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
type ConfigFormat ¶
type ConfigFormat int32
Configuration serialization format.
const ( ConfigFormat_Protobuf ConfigFormat = 0 ConfigFormat_JSON ConfigFormat = 1 )
func (ConfigFormat) EnumDescriptor ¶
func (ConfigFormat) EnumDescriptor() ([]byte, []int)
func (ConfigFormat) String ¶
func (x ConfigFormat) String() string
type InboundConnectionConfig ¶
type InboundConnectionConfig struct { // Protocol specific settings. Must be one of the supported protocols. Settings *v2ray_core_common_loader.TypedSettings `protobuf:"bytes,1,opt,name=settings" json:"settings,omitempty"` // Range of port number to run on. Both inclusive. PortRange *v2ray_core_common_net.PortRange `protobuf:"bytes,2,opt,name=port_range,json=portRange" json:"port_range,omitempty"` // IP address to listen on. 0.0.0.0 if unset. ListenOn *v2ray_core_common_net1.IPOrDomain `protobuf:"bytes,3,opt,name=listen_on,json=listenOn" json:"listen_on,omitempty"` // Tag of this handler. Tag string `protobuf:"bytes,4,opt,name=tag" json:"tag,omitempty"` AllocationStrategy *AllocationStrategy `protobuf:"bytes,5,opt,name=allocation_strategy,json=allocationStrategy" json:"allocation_strategy,omitempty"` StreamSettings *v2ray_core_transport_internet.StreamConfig `protobuf:"bytes,6,opt,name=stream_settings,json=streamSettings" json:"stream_settings,omitempty"` AllowPassiveConnection bool `protobuf:"varint,7,opt,name=allow_passive_connection,json=allowPassiveConnection" json:"allow_passive_connection,omitempty"` }
Config for an inbound connection handler.
func (*InboundConnectionConfig) Descriptor ¶
func (*InboundConnectionConfig) Descriptor() ([]byte, []int)
func (*InboundConnectionConfig) GetAllocationStrategy ¶
func (m *InboundConnectionConfig) GetAllocationStrategy() *AllocationStrategy
func (*InboundConnectionConfig) GetAllocationStrategyValue ¶
func (this *InboundConnectionConfig) GetAllocationStrategyValue() *AllocationStrategy
func (*InboundConnectionConfig) GetListenOn ¶
func (m *InboundConnectionConfig) GetListenOn() *v2ray_core_common_net1.IPOrDomain
func (*InboundConnectionConfig) GetListenOnValue ¶
func (this *InboundConnectionConfig) GetListenOnValue() v2net.Address
func (*InboundConnectionConfig) GetPortRange ¶
func (m *InboundConnectionConfig) GetPortRange() *v2ray_core_common_net.PortRange
func (*InboundConnectionConfig) GetSettings ¶
func (m *InboundConnectionConfig) GetSettings() *v2ray_core_common_loader.TypedSettings
func (*InboundConnectionConfig) GetStreamSettings ¶
func (m *InboundConnectionConfig) GetStreamSettings() *v2ray_core_transport_internet.StreamConfig
func (*InboundConnectionConfig) GetTypedSettings ¶
func (this *InboundConnectionConfig) GetTypedSettings() (interface{}, error)
func (*InboundConnectionConfig) ProtoMessage ¶
func (*InboundConnectionConfig) ProtoMessage()
func (*InboundConnectionConfig) Reset ¶
func (m *InboundConnectionConfig) Reset()
func (*InboundConnectionConfig) String ¶
func (m *InboundConnectionConfig) String() string
type InboundDetourHandler ¶
type InboundDetourHandler interface { Start() error Close() GetConnectionHandler() (proxy.InboundHandler, int) }
type InboundDetourHandlerAlways ¶
type InboundDetourHandlerAlways struct {
// contains filtered or unexported fields
}
Handler for inbound detour connections.
func NewInboundDetourHandlerAlways ¶
func NewInboundDetourHandlerAlways(space app.Space, config *InboundConnectionConfig) (*InboundDetourHandlerAlways, error)
func (*InboundDetourHandlerAlways) Close ¶
func (this *InboundDetourHandlerAlways) Close()
func (*InboundDetourHandlerAlways) GetConnectionHandler ¶
func (this *InboundDetourHandlerAlways) GetConnectionHandler() (proxy.InboundHandler, int)
func (*InboundDetourHandlerAlways) Start ¶
func (this *InboundDetourHandlerAlways) Start() error
Starts the inbound connection handler.
type InboundDetourHandlerDynamic ¶
func NewInboundDetourHandlerDynamic ¶
func NewInboundDetourHandlerDynamic(space app.Space, config *InboundConnectionConfig) (*InboundDetourHandlerDynamic, error)
func (*InboundDetourHandlerDynamic) Close ¶
func (this *InboundDetourHandlerDynamic) Close()
func (*InboundDetourHandlerDynamic) GetConnectionHandler ¶
func (this *InboundDetourHandlerDynamic) GetConnectionHandler() (proxy.InboundHandler, int)
func (*InboundDetourHandlerDynamic) RecyleHandles ¶
func (this *InboundDetourHandlerDynamic) RecyleHandles()
func (*InboundDetourHandlerDynamic) Start ¶
func (this *InboundDetourHandlerDynamic) Start() error
type OutboundConnectionConfig ¶
type OutboundConnectionConfig struct { Settings *v2ray_core_common_loader.TypedSettings `protobuf:"bytes,1,opt,name=settings" json:"settings,omitempty"` // IP address to send data through. 0.0.0.0 if unset. SendThrough *v2ray_core_common_net1.IPOrDomain `protobuf:"bytes,2,opt,name=send_through,json=sendThrough" json:"send_through,omitempty"` StreamSettings *v2ray_core_transport_internet.StreamConfig `protobuf:"bytes,3,opt,name=stream_settings,json=streamSettings" json:"stream_settings,omitempty"` Tag string `protobuf:"bytes,4,opt,name=tag" json:"tag,omitempty"` }
Config for an outbound connection handler.
func (*OutboundConnectionConfig) Descriptor ¶
func (*OutboundConnectionConfig) Descriptor() ([]byte, []int)
func (*OutboundConnectionConfig) GetSendThrough ¶
func (m *OutboundConnectionConfig) GetSendThrough() *v2ray_core_common_net1.IPOrDomain
func (*OutboundConnectionConfig) GetSendThroughValue ¶
func (this *OutboundConnectionConfig) GetSendThroughValue() v2net.Address
func (*OutboundConnectionConfig) GetSettings ¶
func (m *OutboundConnectionConfig) GetSettings() *v2ray_core_common_loader.TypedSettings
func (*OutboundConnectionConfig) GetStreamSettings ¶
func (m *OutboundConnectionConfig) GetStreamSettings() *v2ray_core_transport_internet.StreamConfig
func (*OutboundConnectionConfig) GetTypedSettings ¶
func (this *OutboundConnectionConfig) GetTypedSettings() (interface{}, error)
func (*OutboundConnectionConfig) ProtoMessage ¶
func (*OutboundConnectionConfig) ProtoMessage()
func (*OutboundConnectionConfig) Reset ¶
func (m *OutboundConnectionConfig) Reset()
func (*OutboundConnectionConfig) String ¶
func (m *OutboundConnectionConfig) String() string
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
Point shell of V2Ray.
func NewPoint ¶
NewPoint returns a new Point server based on given configuration. The server is not started at this point.
func (*Point) GetHandler ¶
func (this *Point) GetHandler(tag string) (proxy.InboundHandler, int)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
dns
Package dns is a generated protocol buffer package.
|
Package dns is a generated protocol buffer package. |
router
Package router is a generated protocol buffer package.
|
Package router is a generated protocol buffer package. |
Package common contains common utilities that are shared among other packages.
|
Package common contains common utilities that are shared among other packages. |
alloc
Package alloc provides a light-weight memory allocation mechanism.
|
Package alloc provides a light-weight memory allocation mechanism. |
crypto/internal
GENERATED CODE.
|
GENERATED CODE. |
dice
Package dice contains common functions to generate random number.
|
Package dice contains common functions to generate random number. |
loader
Package loader is a generated protocol buffer package.
|
Package loader is a generated protocol buffer package. |
log
Package log is a generated protocol buffer package.
|
Package log is a generated protocol buffer package. |
net
Package net is a generated protocol buffer package.
|
Package net is a generated protocol buffer package. |
protocol
Package protocol is a generated protocol buffer package.
|
Package protocol is a generated protocol buffer package. |
Package proxy contains all proxies used by V2Ray.
|
Package proxy contains all proxies used by V2Ray. |
blackhole
Package blackhole is a generated protocol buffer package.
|
Package blackhole is a generated protocol buffer package. |
dokodemo
Package dokodemo is a generated protocol buffer package.
|
Package dokodemo is a generated protocol buffer package. |
freedom
Package freedom is a generated protocol buffer package.
|
Package freedom is a generated protocol buffer package. |
http
Package http is a generated protocol buffer package.
|
Package http is a generated protocol buffer package. |
shadowsocks
Package shadowsocks is a generated protocol buffer package.
|
Package shadowsocks is a generated protocol buffer package. |
socks
Package socks is a generated protocol buffer package.
|
Package socks is a generated protocol buffer package. |
vmess
Package vmess is a generated protocol buffer package.
|
Package vmess is a generated protocol buffer package. |
vmess/inbound
Package inbound is a generated protocol buffer package.
|
Package inbound is a generated protocol buffer package. |
vmess/outbound
Package outbound is a generated protocol buffer package.
|
Package outbound is a generated protocol buffer package. |
testing
|
|
Package tools contains utilities that is not directly linked into V2Ray binary.
|
Package tools contains utilities that is not directly linked into V2Ray binary. |
geoip
Package geoip is a generated protocol buffer package.
|
Package geoip is a generated protocol buffer package. |
Package transport is a generated protocol buffer package.
|
Package transport is a generated protocol buffer package. |
internet
Package internet is a generated protocol buffer package.
|
Package internet is a generated protocol buffer package. |
internet/authenticators/noop
Package noop is a generated protocol buffer package.
|
Package noop is a generated protocol buffer package. |
internet/authenticators/srtp
Package srtp is a generated protocol buffer package.
|
Package srtp is a generated protocol buffer package. |
internet/authenticators/utp
Package utp is a generated protocol buffer package.
|
Package utp is a generated protocol buffer package. |
internet/kcp
Package kcp is a generated protocol buffer package.
|
Package kcp is a generated protocol buffer package. |
internet/tcp
Package tcp is a generated protocol buffer package.
|
Package tcp is a generated protocol buffer package. |
internet/tls
Package tls is a generated protocol buffer package.
|
Package tls is a generated protocol buffer package. |
internet/ws
Package ws is a generated protocol buffer package.
|
Package ws is a generated protocol buffer package. |
Click to show internal directories.
Click to hide internal directories.