comm

package
v0.0.0-...-fab123d Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRoute

func AddRoute(tunAddr string, tunGw string, tunMask string)

func CheckTcp

func CheckTcp(host string, port string) bool

func CmdHide

func CmdHide(name string, arg ...string) *exec.Cmd

func ConnPipe

func ConnPipe(src CommConn, dst CommConn, duration time.Duration)

tcp swap

func ExistStdOutput

func ExistStdOutput() bool

func GenPasswordHead

func GenPasswordHead(password string) string

func GetFreePort

func GetFreePort() (string, error)

func GetFreeUdpPort

func GetFreeUdpPort() (string, error)

func GetGateway

func GetGateway() string

func GetNetworkInfo

func GetNetworkInfo() ([]lAddr, error)

func GetUnusedTunAddr

func GetUnusedTunAddr() (string, string)

get Unused B return tunaddr tungw

func InitLog

func InitLog(_logfile string, flag int)

func IsPublicIP

func IsPublicIP(ip net.IP) bool

func ReadConf

func ReadConf(configFile string) ([]byte, bool, error)

func Tail

func Tail(name string, cutLine int) string

func UniqueId

func UniqueId(_len int) string

生成Guid字串

Types

type CommConn

type CommConn interface {
	SetReadDeadline(t time.Time) error
	SetWriteDeadline(t time.Time) error
	io.ReadWriteCloser
}

type HttpConn

type HttpConn struct {
	W  io.Writer
	Wf http.Flusher
	R  io.ReadCloser
}

func (HttpConn) Close

func (conn HttpConn) Close() error

func (HttpConn) Read

func (conn HttpConn) Read(buf []byte) (int, error)

func (HttpConn) SetReadDeadline

func (conn HttpConn) SetReadDeadline(t time.Time) error

func (HttpConn) SetWriteDeadline

func (conn HttpConn) SetWriteDeadline(t time.Time) error

func (HttpConn) Write

func (conn HttpConn) Write(buf []byte) (int, error)

type TimeoutConn

type TimeoutConn struct {
	Conn    CommConn
	TimeOut time.Duration
}

func (TimeoutConn) Read

func (conn TimeoutConn) Read(buf []byte) (int, error)

func (TimeoutConn) Write

func (conn TimeoutConn) Write(buf []byte) (int, error)

type UdpLimit

type UdpLimit struct {
	Limit   *rate.Limiter
	Expired int64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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