proxy

package
v2.16.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package proxy contains all proxies used by V2Ray.

Index

Constants

This section is empty.

Variables

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

Functions

func AllowPassiveConnectionFromContext

func AllowPassiveConnectionFromContext(ctx context.Context) (bool, bool)

func ContextWithAllowPassiveConnection

func ContextWithAllowPassiveConnection(ctx context.Context, allowPassiveConnection bool) context.Context

func ContextWithDestination

func ContextWithDestination(ctx context.Context, dest net.Destination) context.Context

func ContextWithDialer

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

func ContextWithInboundDestination

func ContextWithInboundDestination(ctx context.Context, dest net.Destination) context.Context

func ContextWithInboundTag

func ContextWithInboundTag(ctx context.Context, tag string) context.Context

func ContextWithOriginalDestination

func ContextWithOriginalDestination(ctx context.Context, dest net.Destination) context.Context

func ContextWithOutboundTag

func ContextWithOutboundTag(ctx context.Context, tag string) context.Context

func ContextWithResolveIPs

func ContextWithResolveIPs(ctx context.Context, ips []net.Address) context.Context

func ContextWithSource

func ContextWithSource(ctx context.Context, src net.Destination) context.Context

func DestinationFromContext

func DestinationFromContext(ctx context.Context) net.Destination

func InboundDestinationFromContext

func InboundDestinationFromContext(ctx context.Context) net.Destination

func InboundTagFromContext

func InboundTagFromContext(ctx context.Context) string

func OriginalDestinationFromContext

func OriginalDestinationFromContext(ctx context.Context) net.Destination

func OutboundTagFromContext

func OutboundTagFromContext(ctx context.Context) string

func ResolvedIPsFromContext

func ResolvedIPsFromContext(ctx context.Context) ([]net.Address, bool)

func SourceFromContext

func SourceFromContext(ctx context.Context) net.Destination

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

type Inbound interface {
	Network() net.NetworkList

	Process(context.Context, net.Network, internet.Connection) error
}

An Inbound processes inbound connections.

func CreateInboundHandler

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

type Outbound added in v1.1.0

type Outbound interface {
	Process(context.Context, ray.OutboundRay) error
}

An Outbound process outbound connections.

func CreateOutboundHandler

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

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