Documentation ¶
Overview ¶
Package core provides an entry point to use V2Ray core functionalities.
V2Ray makes it possible to accept incoming network connections with certain protocol, process the data, and send them through another connection with the same or a difference protocol on demand.
It may be configured to work with multiple protocols at the same time, and uses the internal router to tunnel through different inbound and outbound connections.
Index ¶
- Variables
- func PrintVersion()
- func RegisterConfigLoader(format ConfigFormat, loader ConfigLoader) error
- func Version() string
- type Config
- func (*Config) Descriptor() ([]byte, []int)
- func (m *Config) GetApp() []*v2ray_core_common_serial.TypedMessage
- func (m *Config) GetExtension() []*v2ray_core_common_serial.TypedMessage
- func (m *Config) GetInbound() []*v2ray_core_app_proxyman.InboundHandlerConfig
- func (m *Config) GetOutbound() []*v2ray_core_app_proxyman.OutboundHandlerConfig
- 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 Server
Constants ¶
This section is empty.
Variables ¶
var ConfigFormat_name = map[int32]string{
0: "Protobuf",
1: "JSON",
}
var ConfigFormat_value = map[string]int32{
"Protobuf": 0,
"JSON": 1,
}
Functions ¶
func PrintVersion ¶ added in v0.9.1
func PrintVersion()
PrintVersion prints current version into console.
func RegisterConfigLoader ¶
func RegisterConfigLoader(format ConfigFormat, loader ConfigLoader) error
RegisterConfigLoader add a new ConfigLoader.
Types ¶
type Config ¶
type Config struct { // Inbound handler configurations. Must have at least one item. Inbound []*v2ray_core_app_proxyman.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 []*v2ray_core_app_proxyman.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"` }
Master config of V2Ray. V2Ray Core takes this config as input and functions accordingly.
func LoadConfig ¶
func LoadConfig(format ConfigFormat, input io.Reader) (*Config, error)
LoadConfig loads config with given format from given source.
func (*Config) Descriptor ¶
func (*Config) GetApp ¶
func (m *Config) GetApp() []*v2ray_core_common_serial.TypedMessage
func (*Config) GetExtension ¶
func (m *Config) GetExtension() []*v2ray_core_common_serial.TypedMessage
func (*Config) GetInbound ¶
func (m *Config) GetInbound() []*v2ray_core_app_proxyman.InboundHandlerConfig
func (*Config) GetOutbound ¶
func (m *Config) GetOutbound() []*v2ray_core_app_proxyman.OutboundHandlerConfig
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 ConfigLoader ¶
ConfigLoader is an utility to load V2Ray config from external source.
type Server ¶
type Server interface { // Start starts the V2Ray server, and return any error during the process. // In the case of any errors, the state of the server is unpredicatable. Start() error // Close closes the V2Ray server. All inbound and outbound connections will be closed immediately. Close() }
Server is an instance of V2Ray. At any time, there must be at most one Server instance running.
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. |
crypto
Package crypto provides common crypto libraries for V2Ray.
|
Package crypto provides common crypto libraries for V2Ray. |
dice
Package dice contains common functions to generate random number.
|
Package dice contains common functions to generate random number. |
errors
Package errors is a drop-in replacement for Golang lib 'errors'.
|
Package errors is a drop-in replacement for Golang lib 'errors'. |
net
Package net is a drop-in replacement to Golang's net package, with some more functionalities.
|
Package net is a drop-in replacement to Golang's net package, with some more functionalities. |
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 |