proxy

package
v2.13.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package proxy contains all proxies used by V2Ray.

Index

Constants

View Source
const (
	HandlerStateStopped = HandlerState(0)
	HandlerStateRunning = HandlerState(1)
)

Variables

View Source
var (
	ErrInvalidProtocolVersion = errors.New("Invalid protocol version.")
	ErrAlreadyListening       = errors.New("Already listening on another port.")
)

Functions

func RegisterInboundHandlerCreator

func RegisterInboundHandlerCreator(name string, creator InboundHandlerFactory) error

func RegisterOutboundHandlerCreator

func RegisterOutboundHandlerCreator(name string, creator OutboundHandlerFactory) error

Types

type HandlerState added in v1.11.1

type HandlerState int

type InboundHandler added in v1.9.1

type InboundHandler interface {
	// Listen starts a InboundHandler.
	Start() error
	// Close stops the handler to accepting anymore inbound connections.
	Close()
	// Port returns the port that the handler is listening on.
	Port() v2net.Port
}

An InboundHandler handles inbound network connections to V2Ray.

func CreateInboundHandler

func CreateInboundHandler(name string, space app.Space, config interface{}, meta *InboundHandlerMeta) (InboundHandler, error)

type InboundHandlerFactory

type InboundHandlerFactory interface {
	StreamCapability() v2net.NetworkList
	Create(space app.Space, config interface{}, meta *InboundHandlerMeta) (InboundHandler, error)
}

type InboundHandlerMeta added in v1.17.1

type InboundHandlerMeta struct {
	Tag                    string
	Address                v2net.Address
	Port                   v2net.Port
	AllowPassiveConnection bool
	StreamSettings         *internet.StreamConfig
}

type OutboundHandler added in v1.9.1

type OutboundHandler interface {
	// Dispatch sends one or more Packets to its destination.
	Dispatch(destination v2net.Destination, ray ray.OutboundRay)
}

An OutboundHandler handles outbound network connection for V2Ray.

func CreateOutboundHandler

func CreateOutboundHandler(name string, space app.Space, config interface{}, meta *OutboundHandlerMeta) (OutboundHandler, error)

type OutboundHandlerFactory

type OutboundHandlerFactory interface {
	StreamCapability() v2net.NetworkList
	Create(space app.Space, config interface{}, meta *OutboundHandlerMeta) (OutboundHandler, error)
}

type OutboundHandlerMeta added in v1.17.1

type OutboundHandlerMeta struct {
	Tag            string
	Address        v2net.Address
	StreamSettings *internet.StreamConfig
	ProxySettings  *internet.ProxyConfig
}

func (*OutboundHandlerMeta) GetDialerOptions

func (v *OutboundHandlerMeta) GetDialerOptions() internet.DialerOptions

type SessionInfo added in v1.24.1

type SessionInfo struct {
	Source      v2net.Destination
	Destination v2net.Destination
	User        *protocol.User
	Inbound     *InboundHandlerMeta
}

Directories

Path Synopsis
Package blackhole is an outbound handler that blocks all connections.
Package blackhole is an outbound handler that blocks all connections.
Package shadowsocks provides compatible functionality to Shadowsocks.
Package shadowsocks provides compatible functionality to Shadowsocks.
Package vmess contains the implementation of VMess protocol and transportation.
Package vmess contains the implementation of VMess protocol and transportation.

Jump to

Keyboard shortcuts

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