proxy

package
v5.0.0-...-470bbe4 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package proxy contains all proxies used by V2Ray.

To implement an inbound or outbound proxy, one needs to do the following: 1. Implement the interface(s) below. 2. Register a config creator through common.RegisterConfig.

Index

Constants

View Source
const FirstPayloadTimeout = 100 * time.Millisecond

A timeout for reading the first payload from the client, used in 0-RTT optimizations.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetInbound

type GetInbound interface {
	GetInbound() Inbound
}

type GetOutbound

type GetOutbound interface {
	GetOutbound() Outbound
}

type Inbound

type Inbound interface {
	// Network returns a list of networks that this inbound supports. Connections with not-supported networks will not be passed into Process().
	Network() []net.Network

	// Process processes a connection of given network. If necessary, the Inbound can dispatch the connection to an Outbound.
	Process(context.Context, net.Network, internet.Connection, routing.Dispatcher) error
}

An Inbound processes inbound connections.

type Outbound

type Outbound interface {
	// Process processes the given connection. The given dialer may be used to dial a system outbound connection.
	Process(context.Context, *transport.Link, internet.Dialer) error
}

An Outbound process outbound connections.

type UserManager

type UserManager interface {
	// AddUser adds a new user.
	AddUser(context.Context, *protocol.MemoryUser) error

	// RemoveUser removes a user by email.
	RemoveUser(context.Context, string) error
}

UserManager is the interface for Inbounds and Outbounds that can manage their users.

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 vless contains the implementation of VLess protocol and transportation.
Package vless contains the implementation of VLess protocol and transportation.
Package vlite contains the integration code for VLite protocol variety
Package vlite contains the integration code for VLite protocol variety
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