proxy

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FallbackProxyServer

type FallbackProxyServer interface {
	ProxyServer
	// if okToFallback, it means all data (if any) that has been read from net.Conn is cached in cached and there
	// is no write into the conn, therefore, okay to fallback. cached might be nil; err is the reason for not able to processs.
	//
	// if not okToFallback, then cached is nil, and err is same as Process()
	FallbackProcess(context.Context, net.Conn) (okToFallback bool, cached buf.MultiBuffer, err error)
}

type Inbound

type Inbound interface {
	Tag() string
	common.Runnable
	UserManage
}

func NewInbound

func NewInbound(config *configs.ProxyInboundConfig, ha i.Handler, tp i.TimeoutSetting) (Inbound, error)

type InboundManager

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

func NewManager

func NewManager() *InboundManager

func (*InboundManager) AddInbound

func (m *InboundManager) AddInbound(handler Inbound) error

func (*InboundManager) Close

func (m *InboundManager) Close() error

func (*InboundManager) GetInbound

func (m *InboundManager) GetInbound(tag string) (Inbound, error)

func (*InboundManager) GetInbounds

func (m *InboundManager) GetInbounds() []Inbound

func (*InboundManager) RemoveInbound

func (m *InboundManager) RemoveInbound(tag string) error

RemoveInbound implements inbound.Manager.

func (*InboundManager) Start

func (m *InboundManager) Start() error

type ProxyInbound

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

implements i.InboundHandler

func (*ProxyInbound) AddUser

func (h *ProxyInbound) AddUser(user i.User)

func (*ProxyInbound) Close

func (h *ProxyInbound) Close() error

Close implements common.Closable.

func (*ProxyInbound) RemoveUser

func (h *ProxyInbound) RemoveUser(uid, secret string)

func (*ProxyInbound) Start

func (h *ProxyInbound) Start() error

Start implements common.Runnable.

func (*ProxyInbound) Tag

func (h *ProxyInbound) Tag() string

func (*ProxyInbound) WithOnUnauthorizedRequest

func (h *ProxyInbound) WithOnUnauthorizedRequest(f i.UnauthorizedReport)

type ProxyServer

type ProxyServer 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(context.Context, net.Conn) error
}

type UserManage

type UserManage interface {
	AddUser(user i.User)
	RemoveUser(uid, secret string)
	WithOnUnauthorizedRequest(f i.UnauthorizedReport)
}

Jump to

Keyboard shortcuts

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