socks

package
v0.0.0-...-3a0aedd Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMemLoop

func CheckMemLoop(mb uint64)

func CheckProcess

func CheckProcess(ctx context.Context, pidOld int)

func RerunAfter

func RerunAfter(pid int) (err error)

Types

type Peer

type Peer struct {
	TsLast      int64
	LocalAddrs  string
	RemoteAddrs string
	rpc.Peer
}

type SocksCli

type SocksCli struct {
	Name      string
	SocksAddr string
	ChPeer    chan *Peer
}

func (*SocksCli) Close

func (p *SocksCli) Close(ctx context.Context, in *pb.CloseReq) (out *pb.CloseRsp, err error)

func (*SocksCli) CopyLoop

func (p *SocksCli) CopyLoop(ctx context.Context, cancel context.CancelFunc, rwc io.ReadWriteCloser, peer *Peer, addr string) (err error)

func (*SocksCli) GetPeer

func (p *SocksCli) GetPeer(ctx context.Context) (peer *Peer)

func (*SocksCli) RunConn

func (p *SocksCli) RunConn(ctx context.Context, cancel context.CancelFunc, addr string, tlsConfig *tls.Config)

创建备用connect,提前三次握手较少延时

func (*SocksCli) RunLocal

func (p *SocksCli) RunLocal(ctx context.Context, cancel context.CancelFunc, socksAddr string)

Listen on addr and proxy to server to reach target from getAddr.

func (*SocksCli) RunQuicConn

func (p *SocksCli) RunQuicConn(ctx context.Context, cancel context.CancelFunc, addr string, tlsConfig *tls.Config)

创建备用connect,提前三次握手较少延时

type SocksProxy

type SocksProxy struct {
	SocksSvc

	Svc SocksCli
}

func NewSocksProxy

func NewSocksProxy(ctx context.Context, cancel context.CancelFunc, remoteAddr, svcAddr, name string, tlsConfig *tls.Config, peerFrom rpc.Peer, rwc io.ReadWriteCloser) (p *SocksProxy)

func (*SocksProxy) Close

func (p *SocksProxy) Close(ctx context.Context, req *pb.CloseReq) (resp *pb.CloseRsp, err error)

func (*SocksProxy) Conn

func (p *SocksProxy) Conn(ctx context.Context, req *pb.ConnReq) (resp *pb.ConnRsp, err error)

type SocksSvc

type SocksSvc struct {
	Name       string
	LocalAddr  string
	RemoteAddr string
	Peer       rpc.Peer
}

func (*SocksSvc) Auth

func (s *SocksSvc) Auth(ctx context.Context, req *pb.AuthReq) (resp *pb.AuthRsp, err error)

func (*SocksSvc) Close

func (p *SocksSvc) Close(ctx context.Context, in *pb.CloseReq) (out *pb.CloseRsp, err error)

func (*SocksSvc) Conn

func (p *SocksSvc) Conn(ctx context.Context, req *pb.ConnReq) (resp *pb.ConnRsp, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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