proxy

package
v2.15.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 16, 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 ContextWithDialer

func ContextWithDialer(ctx context.Context, dialer Dialer) context.Context

func ContextWithInboundMeta

func ContextWithInboundMeta(ctx context.Context, meta *InboundHandlerMeta) context.Context

func ContextWithOutboundMeta

func ContextWithOutboundMeta(ctx context.Context, meta *OutboundHandlerMeta) context.Context

Types

type Dialer

type Dialer interface {
	Dial(ctx context.Context, destination net.Destination) (internet.Connection, error)
}

Dialer is used by OutboundHandler for creating outbound connections.

func DialerFromContext

func DialerFromContext(ctx context.Context) Dialer

type HandlerState added in v1.11.2

type HandlerState int

type InboundHandler

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() net.Port

	Network() net.NetworkList
}

An InboundHandler handles inbound network connections to V2Ray.

func CreateInboundHandler

func CreateInboundHandler(ctx context.Context, config interface{}) (InboundHandler, error)

type InboundHandlerMeta added in v1.17.2

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

func InboundMetaFromContext

func InboundMetaFromContext(ctx context.Context) *InboundHandlerMeta

type OutboundHandler

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

An OutboundHandler handles outbound network connection for V2Ray.

func CreateOutboundHandler

func CreateOutboundHandler(ctx context.Context, config interface{}) (OutboundHandler, error)

type OutboundHandlerMeta added in v1.17.2

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

func OutboundMetaFromContext

func OutboundMetaFromContext(ctx context.Context) *OutboundHandlerMeta

func (*OutboundHandlerMeta) GetDialerOptions

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

type SessionInfo added in v1.24.1

type SessionInfo struct {
	Source      net.Destination
	Destination net.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 socks provides implements of Socks protocol 4, 4a and 5.
Package socks provides implements of Socks protocol 4, 4a and 5.
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