Documentation ¶
Overview ¶
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 (v *AllocationStrategy) GetConcurrencyValue() uint32
- func (m *AllocationStrategy) GetRefresh() *AllocationStrategyRefresh
- func (v *AllocationStrategy) GetRefreshValue() uint32
- func (m *AllocationStrategy) GetType() AllocationStrategy_Type
- 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_serial.TypedMessage
- 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 (v *InboundConnectionConfig) GetAllocationStrategyValue() *AllocationStrategy
- func (m *InboundConnectionConfig) GetAllowPassiveConnection() bool
- func (m *InboundConnectionConfig) GetListenOn() *v2ray_core_common_net1.IPOrDomain
- func (v *InboundConnectionConfig) GetListenOnValue() net.Address
- func (m *InboundConnectionConfig) GetPortRange() *v2ray_core_common_net.PortRange
- func (m *InboundConnectionConfig) GetSettings() *v2ray_core_common_serial.TypedMessage
- func (m *InboundConnectionConfig) GetStreamSettings() *v2ray_core_transport_internet.StreamConfig
- func (m *InboundConnectionConfig) GetTag() string
- func (v *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) GetProxySettings() *v2ray_core_transport_internet.ProxyConfig
- func (m *OutboundConnectionConfig) GetSendThrough() *v2ray_core_common_net1.IPOrDomain
- func (v *OutboundConnectionConfig) GetSendThroughValue() net.Address
- func (m *OutboundConnectionConfig) GetSettings() *v2ray_core_common_serial.TypedMessage
- func (m *OutboundConnectionConfig) GetStreamSettings() *v2ray_core_transport_internet.StreamConfig
- func (m *OutboundConnectionConfig) GetTag() string
- func (v *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) GetConcurrencyValue ¶
func (v *AllocationStrategy) GetConcurrencyValue() uint32
func (*AllocationStrategy) GetRefresh ¶
func (m *AllocationStrategy) GetRefresh() *AllocationStrategyRefresh
func (*AllocationStrategy) GetRefreshValue ¶
func (v *AllocationStrategy) GetRefreshValue() uint32
func (*AllocationStrategy) GetType ¶
func (m *AllocationStrategy) GetType() AllocationStrategy_Type
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 (m *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 (m *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_serial.TypedMessage `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_serial.TypedMessage
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_serial.TypedMessage `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 (v *InboundConnectionConfig) GetAllocationStrategyValue() *AllocationStrategy
func (*InboundConnectionConfig) GetAllowPassiveConnection ¶
func (m *InboundConnectionConfig) GetAllowPassiveConnection() bool
func (*InboundConnectionConfig) GetListenOn ¶
func (m *InboundConnectionConfig) GetListenOn() *v2ray_core_common_net1.IPOrDomain
func (*InboundConnectionConfig) GetListenOnValue ¶
func (v *InboundConnectionConfig) GetListenOnValue() net.Address
func (*InboundConnectionConfig) GetPortRange ¶
func (m *InboundConnectionConfig) GetPortRange() *v2ray_core_common_net.PortRange
func (*InboundConnectionConfig) GetSettings ¶
func (m *InboundConnectionConfig) GetSettings() *v2ray_core_common_serial.TypedMessage
func (*InboundConnectionConfig) GetStreamSettings ¶
func (m *InboundConnectionConfig) GetStreamSettings() *v2ray_core_transport_internet.StreamConfig
func (*InboundConnectionConfig) GetTag ¶
func (m *InboundConnectionConfig) GetTag() string
func (*InboundConnectionConfig) GetTypedSettings ¶
func (v *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
}
InboundDetourHandlerAlways is a handler for inbound detour connections.
func NewInboundDetourHandlerAlways ¶
func NewInboundDetourHandlerAlways(ctx context.Context, config *InboundConnectionConfig) (*InboundDetourHandlerAlways, error)
func (*InboundDetourHandlerAlways) Close ¶
func (v *InboundDetourHandlerAlways) Close()
func (*InboundDetourHandlerAlways) GetConnectionHandler ¶
func (v *InboundDetourHandlerAlways) GetConnectionHandler() (proxy.InboundHandler, int)
func (*InboundDetourHandlerAlways) Start ¶
func (v *InboundDetourHandlerAlways) Start() error
Start starts the inbound connection handler.
type InboundDetourHandlerDynamic ¶
func NewInboundDetourHandlerDynamic ¶
func NewInboundDetourHandlerDynamic(ctx context.Context, config *InboundConnectionConfig) (*InboundDetourHandlerDynamic, error)
func (*InboundDetourHandlerDynamic) Close ¶
func (v *InboundDetourHandlerDynamic) Close()
func (*InboundDetourHandlerDynamic) GetConnectionHandler ¶
func (v *InboundDetourHandlerDynamic) GetConnectionHandler() (proxy.InboundHandler, int)
func (*InboundDetourHandlerDynamic) RecyleHandles ¶
func (v *InboundDetourHandlerDynamic) RecyleHandles()
func (*InboundDetourHandlerDynamic) Start ¶
func (v *InboundDetourHandlerDynamic) Start() error
type OutboundConnectionConfig ¶
type OutboundConnectionConfig struct { Settings *v2ray_core_common_serial.TypedMessage `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"` ProxySettings *v2ray_core_transport_internet.ProxyConfig `protobuf:"bytes,5,opt,name=proxy_settings,json=proxySettings" json:"proxy_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) GetProxySettings ¶
func (m *OutboundConnectionConfig) GetProxySettings() *v2ray_core_transport_internet.ProxyConfig
func (*OutboundConnectionConfig) GetSendThrough ¶
func (m *OutboundConnectionConfig) GetSendThrough() *v2ray_core_common_net1.IPOrDomain
func (*OutboundConnectionConfig) GetSendThroughValue ¶
func (v *OutboundConnectionConfig) GetSendThroughValue() net.Address
func (*OutboundConnectionConfig) GetSettings ¶
func (m *OutboundConnectionConfig) GetSettings() *v2ray_core_common_serial.TypedMessage
func (*OutboundConnectionConfig) GetStreamSettings ¶
func (m *OutboundConnectionConfig) GetStreamSettings() *v2ray_core_transport_internet.StreamConfig
func (*OutboundConnectionConfig) GetTag ¶
func (m *OutboundConnectionConfig) GetTag() string
func (*OutboundConnectionConfig) GetTypedSettings ¶
func (v *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 (v *Point) GetHandler(tag string) (proxy.InboundHandler, int)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
proxyman
Package proxyman defines applications for manageing inbound and outbound proxies.
|
Package proxyman defines applications for manageing inbound and outbound proxies. |
Package common contains common utilities that are shared among other packages.
|
Package common contains common utilities that are shared among other packages. |
buf
Package buf provides a light-weight memory allocation mechanism.
|
Package buf provides a light-weight memory allocation mechanism. |
bufio
Package bufio is a replacement of the standard golang package bufio.
|
Package bufio is a replacement of the standard golang package bufio. |
crypto
Package crypto provides common crypto libraries for V2Ray.
|
Package crypto provides common crypto libraries for V2Ray. |
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. |
net
Package net contains common network utilities.
|
Package net contains common network utilities. |
Package proxy contains all proxies used by V2Ray.
|
Package proxy contains all proxies used by V2Ray. |
blackhole
Package blackhole is an outbound handler that blocks all connections.
|
Package blackhole is an outbound handler that blocks all connections. |
shadowsocks
Package shadowsocks provides compatible functionality to Shadowsocks.
|
Package shadowsocks provides compatible functionality to Shadowsocks. |
socks
Package socks provides implements of Socks protocol 4, 4a and 5.
|
Package socks provides implements of Socks protocol 4, 4a and 5. |
vmess
Package vmess contains the implementation of VMess protocol and transportation.
|
Package vmess contains the implementation of VMess protocol and transportation. |
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. |
internet/kcp
Package kcp - A Fast and Reliable ARQ Protocol
|
Package kcp - A Fast and Reliable ARQ Protocol |
internet/websocket
Package websocket implements Websocket transport
|
Package websocket implements Websocket transport |
Click to show internal directories.
Click to hide internal directories.