Versions in this module Expand all Collapse all v0 v0.26.19 Jul 2, 2024 Changes in this version + func GetMapKeys(m sync.Map, isSort bool, sortKey, order string) (keys []int) + type Client struct + Addr string + BlackIpList []string + Cnf *Config + ConfigConnAllow bool + Flow *Flow + Id int + IsConnect bool + LastOnlineTime string + MaxConn int + MaxTunnelNum int + NoDisplay bool + NoStore bool + NowConn int32 + Rate *rate.Rate + RateLimit int + Remark string + Status bool + VerifyKey string + Version string + WebPassword string + WebUserName string + func NewClient(vKey string, noStore bool, noDisplay bool) *Client + func (s *Client) AddConn() + func (s *Client) CutConn() + func (s *Client) GetConn() bool + func (s *Client) GetTunnelNum() (num int) + func (s *Client) HasHost(h *Host) bool + func (s *Client) HasTunnel(t *Tunnel) (exist bool) + type Config struct + Compress bool + Crypt bool + P string + U string + type DbUtils struct + JsonDb *JsonDb + var Db *DbUtils + func GetDb() *DbUtils + func (s *DbUtils) DelClient(id int) error + func (s *DbUtils) DelHost(id int) error + func (s *DbUtils) DelTask(id int) error + func (s *DbUtils) GetClient(id int) (c *Client, err error) + func (s *DbUtils) GetClientIdByVkey(vkey string) (id int, err error) + func (s *DbUtils) GetClientList(start, length int, search, sort, order string, clientId int) ([]*Client, int) + func (s *DbUtils) GetGlobal() (c *Glob) + func (s *DbUtils) GetHost(start, length int, id int, search string) ([]*Host, int) + func (s *DbUtils) GetHostById(id int) (h *Host, err error) + func (s *DbUtils) GetIdByVerifyKey(vKey string, addr string) (id int, err error) + func (s *DbUtils) GetInfoByHost(host string, r *http.Request) (h *Host, err error) + func (s *DbUtils) GetTask(id int) (t *Tunnel, err error) + func (s *DbUtils) GetTaskByMd5Password(p string) (t *Tunnel) + func (s *DbUtils) IsHostExist(h *Host) bool + func (s *DbUtils) IsPubClient(id int) bool + func (s *DbUtils) NewClient(c *Client) error + func (s *DbUtils) NewHost(t *Host) error + func (s *DbUtils) NewTask(t *Tunnel) (err error) + func (s *DbUtils) SaveGlobal(t *Glob) error + func (s *DbUtils) UpdateClient(t *Client) error + func (s *DbUtils) UpdateTask(t *Tunnel) error + func (s *DbUtils) VerifyUserName(username string, id int) (res bool) + func (s *DbUtils) VerifyVkey(vkey string, id int) (res bool) + type Flow struct + ExportFlow int64 + FlowLimit int64 + InletFlow int64 + func (s *Flow) Add(in, out int64) + type Glob struct + BlackIpList []string + type Health struct + HealthCheckInterval int + HealthCheckTarget string + HealthCheckTimeout int + HealthCheckType string + HealthMap map[string]int + HealthMaxFail int + HealthNextTime time.Time + HealthRemoveArr []string + HttpHealthUrl string + type Host struct + AutoHttps bool + CertFilePath string + Client *Client + Flow *Flow + HeaderChange string + Host string + HostChange string + Id int + IsClose bool + KeyFilePath string + Location string + NoStore bool + Remark string + Scheme string + Target *Target + type JsonDb struct + ClientFilePath string + ClientIncreaseId int32 + Clients sync.Map + Global *Glob + GlobalFilePath string + HostFilePath string + HostIncreaseId int32 + Hosts sync.Map + HostsTmp sync.Map + RunPath string + TaskFilePath string + TaskIncreaseId int32 + Tasks sync.Map + func NewJsonDb(runPath string) *JsonDb + func (s *JsonDb) GetClient(id int) (c *Client, err error) + func (s *JsonDb) GetClientId() int32 + func (s *JsonDb) GetHostId() int32 + func (s *JsonDb) GetTaskId() int32 + func (s *JsonDb) LoadClientFromJsonFile() + func (s *JsonDb) LoadGlobalFromJsonFile() + func (s *JsonDb) LoadHostFromJsonFile() + func (s *JsonDb) LoadTaskFromJsonFile() + func (s *JsonDb) StoreClientsToJsonFile() + func (s *JsonDb) StoreGlobalToJsonFile() + func (s *JsonDb) StoreHostToJsonFile() + func (s *JsonDb) StoreTasksToJsonFile() + type MultiAccount struct + AccountMap map[string]string + type Pair struct + type PairList []*Pair + func (p PairList) Len() int + func (p PairList) Less(i, j int) bool + func (p PairList) Swap(i, j int) + type Target struct + LocalProxy bool + TargetArr []string + TargetStr string + func (s *Target) GetRandomTarget() (string, error) + type Tunnel struct + Client *Client + Flow *Flow + Id int + IsHttp bool + LocalPath string + Mode string + MultiAccount *MultiAccount + NoStore bool + Password string + Port int + Ports string + Remark string + RunStatus bool + ServerIp string + Status bool + StripPre string + Target *Target + TargetAddr string