point

package
v1.24.4 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2016 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package point is a shell of V2Ray to run on various of systems. Point server is a full functionality proxying system. It consists of an inbound and an outbound connection, as well as any number of inbound and outbound detours. It provides a way internally to route network packets.

Index

Constants

View Source
const (
	AllocationStrategyAlways   = "always"
	AllocationStrategyRandom   = "random"
	AllocationStrategyExternal = "external"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port            v2net.Port
	LogConfig       *LogConfig
	RouterConfig    *router.Config
	DNSConfig       *dns.Config
	InboundConfig   *InboundConnectionConfig
	OutboundConfig  *OutboundConnectionConfig
	InboundDetours  []*InboundDetourConfig
	OutboundDetours []*OutboundDetourConfig
	TransportConfig *transport.Config
}

func LoadConfig

func LoadConfig(init string) (*Config, error)

type ConfigLoader

type ConfigLoader func(init string) (*Config, error)

type InboundConnectionConfig

type InboundConnectionConfig struct {
	Port                   v2net.Port
	ListenOn               v2net.Address
	StreamSettings         *internet.StreamSettings
	Protocol               string
	Settings               []byte
	AllowPassiveConnection bool
}

type InboundDetourAllocationConfig

type InboundDetourAllocationConfig struct {
	Strategy    string // Allocation strategy of this inbound detour.
	Concurrency int    // Number of handlers (ports) running in parallel.
	Refresh     int    // Number of minutes before a handler is regenerated.
}

type InboundDetourConfig

type InboundDetourConfig struct {
	Protocol               string
	PortRange              v2net.PortRange
	ListenOn               v2net.Address
	Tag                    string
	Allocation             *InboundDetourAllocationConfig
	StreamSettings         *internet.StreamSettings
	Settings               []byte
	AllowPassiveConnection bool
}

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 *InboundDetourConfig) (*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

type InboundDetourHandlerDynamic struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewInboundDetourHandlerDynamic

func NewInboundDetourHandlerDynamic(space app.Space, config *InboundDetourConfig) (*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 LogConfig

type LogConfig struct {
	AccessLog string
	ErrorLog  string
	LogLevel  log.LogLevel
}

type OutboundConnectionConfig

type OutboundConnectionConfig struct {
	Protocol       string
	SendThrough    v2net.Address
	StreamSettings *internet.StreamSettings
	Settings       []byte
}

type OutboundDetourConfig

type OutboundDetourConfig struct {
	Protocol       string
	SendThrough    v2net.Address
	StreamSettings *internet.StreamSettings
	Tag            string
	Settings       []byte
}

type Point

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

Point shell of V2Ray.

func NewPoint

func NewPoint(pConfig *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 (this *Point) Close()

func (*Point) GetHandler

func (this *Point) GetHandler(tag string) (proxy.InboundHandler, int)

func (*Point) Release

func (this *Point) Release()

func (*Point) Start

func (this *Point) Start() error

Start starts the Point server, and return any error during the process. In the case of any errors, the state of the server is unpredicatable.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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