core

package module
v2.18.2+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2017 License: MIT Imports: 17 Imported by: 0

README

Project V2Ray

[![Build Status][1]][2] [![codecov.io][3]][4] [![Go Report][5]][6] [![GoDoc][7]][8] [![codebeat][9]][10] [1]: https://travis-ci.org/v2ray/v2ray-core.svg?branch=master "Build Status badge" [2]: https://travis-ci.org/v2ray/v2ray-core "Travis-CI Build Status" [3]: https://codecov.io/github/v2ray/v2ray-core/coverage.svg?branch=master "Coverage badge" [4]: https://codecov.io/github/v2ray/v2ray-core?branch=master "Codecov Status" [5]: https://goreportcard.com/badge/v2ray.com/core "Go Report badge" [6]: https://goreportcard.com/report/v2ray.com/core "Go Report" [7]: https://godoc.org/v2ray.com/core?status.svg "GoDoc badge" [8]: https://godoc.org/v2ray.com/core "GoDoc" [9]: https://codebeat.co/badges/f2354ca8-3e24-463d-a2e3-159af73b2477 "Codebeat badge" [10]: https://codebeat.co/projects/github-com-v2ray-v2ray-core "Codebeat"

V2Ray 是一个模块化的代理软件包,它的目标是提供常用的代理软件模块,简化网络代理软件的开发。

官方网站

V2Ray provides building blocks for network proxy development. Read our Wiki for more information.

License

The MIT License (MIT)

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

Constants

This section is empty.

Variables

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

func PrintVersion()

PrintVersion prints current version into console.

func RegisterConfigLoader added in v1.0.0

func RegisterConfigLoader(format ConfigFormat, loader ConfigLoader) error

RegisterConfigLoader add a new ConfigLoader.

func Version added in v1.0.0

func Version() string

Version returns V2Ray's version as a string.

Types

type Config added in v1.0.0

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 *v2ray_core_transport.Config             `protobuf:"bytes,5,opt,name=transport" json:"transport,omitempty"`
}

func LoadConfig added in v1.0.0

func LoadConfig(format ConfigFormat, input io.Reader) (*Config, error)

LoadConfig loads config with given format from given source.

func (*Config) Descriptor added in v1.0.0

func (*Config) Descriptor() ([]byte, []int)

func (*Config) GetApp added in v1.0.0

func (*Config) GetInbound added in v1.0.0

func (*Config) GetOutbound added in v1.0.0

func (*Config) GetTransport added in v1.0.0

func (m *Config) GetTransport() *v2ray_core_transport.Config

func (*Config) ProtoMessage added in v1.0.0

func (*Config) ProtoMessage()

func (*Config) Reset added in v1.0.0

func (m *Config) Reset()

func (*Config) String added in v1.0.0

func (m *Config) String() string

type ConfigFormat added in v1.0.0

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 added in v1.0.0

type ConfigLoader func(input io.Reader) (*Config, error)

ConfigLoader is an utility to load V2Ray config from external source.

type Point

type Point struct {
	// contains filtered or unexported fields
}

Point shell of V2Ray.

func NewPoint

func NewPoint(config *Config) (*Point, error)

NewPoint returns a new Point server based on given configuration. The server is not started at this point.

func (*Point) Close

func (v *Point) Close()

func (*Point) Start

func (v *Point) Start() error

type Server added in v1.0.0

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.

func New added in v1.0.0

func New(config *Config) (Server, error)

New creates a new V2Ray server with given config.

Directories

Path Synopsis
app
api
dns
log
proxyman
Package proxyman defines applications for manageing inbound and outbound proxies.
Package proxyman defines applications for manageing inbound and outbound proxies.
web
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.
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.
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 contains common network utilities.
Package net contains common network utilities.
web
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
tls
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
ray

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL