proxy

package
v0.29.19 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: GPL-3.0 Imports: 33 Imported by: 0

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 NewHttp

func NewHttp(bridge NetBridge, task *file.Tunnel, httpPort, httpsPort int, httpOnlyPass string, addOrigin bool) *httpServer

func ProcessHttp

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

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

tcp proxy

Types

type BaseServer

type BaseServer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

BaseServer struct

func NewBaseServer

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

func (*BaseServer) CheckFlowAndConnNum

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

check flow limit of the client ,and decrease the allow 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)

add the flow

func (*BaseServer) FlowAddHost

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

change the flow

type HttpsListener

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

HttpsListener wraps a parent listener.

func NewHttpsListener

func NewHttpsListener(l net.Listener) *HttpsListener

func (*HttpsListener) Accept

func (httpsListener *HttpsListener) Accept() (net.Conn, error)

func (*HttpsListener) Addr

func (httpsListener *HttpsListener) Addr() net.Addr

func (*HttpsListener) Close

func (httpsListener *HttpsListener) Close() error

type HttpsServer

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

func NewHttpsServer

func NewHttpsServer(l net.Listener, bridge NetBridge, task *file.Tunnel, srv *http.Server, magic *certmagic.Config) *HttpsServer

func (*HttpsServer) Close

func (https *HttpsServer) Close() error

func (*HttpsServer) NewServer

func (s *HttpsServer) NewServer(port int, scheme string) *http.Server

func (*HttpsServer) Start

func (https *HttpsServer) Start() error

type NetBridge

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

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 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) *TunnelModeServer

tcp|host|mixproxy

func (*TunnelModeServer) Auth added in v0.29.0

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

socks5 auth

func (*TunnelModeServer) Close

func (s *TunnelModeServer) Close() 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) *UdpModeServer

func (*UdpModeServer) Close

func (s *UdpModeServer) Close() error

func (*UdpModeServer) Start

func (s *UdpModeServer) Start() error

type WebServer

type WebServer struct {
	BaseServer
}

func NewWebServer

func NewWebServer(bridge *bridge.Bridge) *WebServer

new

func (*WebServer) Close

func (s *WebServer) Close() error

func (*WebServer) Start

func (s *WebServer) Start() error

Jump to

Keyboard shortcuts

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