proxy

package
v0.34.4 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: GPL-3.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	UserPassAuth = uint8(2)
)

Variables

This section is empty.

Functions

func HandleTrans

func HandleTrans(c *conn.Conn, s *TunnelModeServer) error

func IsGlobalBlackIp

func IsGlobalBlackIp(ipPort string) bool

func ProcessHttp

func ProcessHttp(c *conn.Conn, s *TunnelModeServer) error

ProcessHttp http proxy

func ProcessMix added in v0.29.0

func ProcessMix(c *conn.Conn, s *TunnelModeServer) error

func ProcessTunnel

func ProcessTunnel(c *conn.Conn, s *TunnelModeServer) error

ProcessTunnel tcp proxy

Types

type BaseServer

type BaseServer struct {
	Id              int
	Bridge          NetBridge
	Task            *file.Tunnel
	ErrorContent    []byte
	AllowLocalProxy bool
	sync.Mutex
}

BaseServer struct

func NewBaseServer

func NewBaseServer(bridge NetBridge, task *file.Tunnel, allowLocalProxy bool) *BaseServer

func (*BaseServer) Auth added in v0.30.0

func (s *BaseServer) Auth(r *http.Request, c *conn.Conn, u, p string, multiAccount, userAuth *file.MultiAccount) error

Auth check

func (*BaseServer) CheckFlowAndConnNum

func (s *BaseServer) CheckFlowAndConnNum(client *file.Client) error

CheckFlowAndConnNum check flow limit of the client ,and decrease the allowed num of client

func (*BaseServer) DealClient

func (s *BaseServer) DealClient(c *conn.Conn, client *file.Client, addr string,
	rb []byte, tp string, f func(), flows []*file.Flow, proxyProtocol int, localProxy bool, task *file.Tunnel) error

func (*BaseServer) FlowAdd

func (s *BaseServer) FlowAdd(in, out int64)

FlowAdd add the flow

func (*BaseServer) FlowAddHost

func (s *BaseServer) FlowAddHost(host *file.Host, in, out int64)

FlowAddHost change the flow

type NetBridge

type NetBridge interface {
	SendLinkInfo(clientId int, link *conn.Link, t *file.Tunnel) (target net.Conn, err error)
	IsServer() bool
	CliProcess(c *conn.Conn, tunnelType string)
}

type P2PServer

type P2PServer struct {
	*BaseServer
	// contains filtered or unexported fields
}

func NewP2PServer

func NewP2PServer(p2pPort int) *P2PServer

func (*P2PServer) Start

func (s *P2PServer) Start() error

type SecretServer added in v0.30.4

type SecretServer struct {
	*BaseServer
	// contains filtered or unexported fields
}

func NewSecretServer added in v0.30.4

func NewSecretServer(bridge NetBridge, task *file.Tunnel, allowLocalProxy, allowSecretLink, allowSecretLocal bool) *SecretServer

func (*SecretServer) HandleSecret added in v0.30.4

func (s *SecretServer) HandleSecret(src net.Conn) error

type Service

type Service interface {
	Start() error
	Close() error
}

type TunnelModeServer

type TunnelModeServer struct {
	*BaseServer
	// contains filtered or unexported fields
}

func NewTunnelModeServer

func NewTunnelModeServer(process process, bridge NetBridge, task *file.Tunnel, allowLocalProxy bool) *TunnelModeServer

NewTunnelModeServer tcp|host|mixproxy

func (*TunnelModeServer) Close

func (s *TunnelModeServer) Close() error

func (*TunnelModeServer) DialVirtual added in v0.33.5

func (s *TunnelModeServer) DialVirtual(rAddr string) (net.Conn, error)

func (*TunnelModeServer) ServeVirtual added in v0.33.5

func (s *TunnelModeServer) ServeVirtual(c net.Conn)

func (*TunnelModeServer) SocksAuth added in v0.30.0

func (s *TunnelModeServer) SocksAuth(c net.Conn) error

func (*TunnelModeServer) Start

func (s *TunnelModeServer) Start() error

type UdpModeServer

type UdpModeServer struct {
	*BaseServer
	// contains filtered or unexported fields
}

func NewUdpModeServer

func NewUdpModeServer(bridge NetBridge, task *file.Tunnel, allowLocalProxy bool) *UdpModeServer

func (*UdpModeServer) Close

func (s *UdpModeServer) Close() error

func (*UdpModeServer) Start

func (s *UdpModeServer) Start() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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