Documentation
¶
Index ¶
- func GetMapKeys(m sync.Map, isSort bool, sortKey, order string) (keys []int)
- type Client
- type Config
- type 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) 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) 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
- type Health
- type Host
- type 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) LoadHostFromJsonFile()
- func (s *JsonDb) LoadTaskFromJsonFile()
- func (s *JsonDb) StoreClientsToJsonFile()
- func (s *JsonDb) StoreHostToJsonFile()
- func (s *JsonDb) StoreTasksToJsonFile()
- type MultiAccount
- type Pair
- type PairList
- type Target
- type Tunnel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
Cnf *Config
Id int //id
VerifyKey string //verify key
Addr string //the ip of client
Remark string //remark
Status bool //is allow connect
IsConnect bool //is the client connect
RateLimit int //rate /kb
Flow *Flow //flow setting
Rate *rate.Rate //rate limit
NoStore bool //no store to file
NoDisplay bool //no display on web
MaxConn int //the max connection num of client allow
NowConn int32 //the connection num of now
WebUserName string //the username of web login
WebPassword string //the password of web login
ConfigConnAllow bool //is allow connected by config file
MaxTunnelNum int
Version string
sync.RWMutex
}
func (*Client) GetTunnelNum ¶ added in v0.22.0
type DbUtils ¶ added in v0.21.0
type DbUtils struct {
JsonDb *JsonDb
}
var (
Db *DbUtils
)
func (*DbUtils) GetClientIdByVkey ¶ added in v0.21.0
func (*DbUtils) GetClientList ¶ added in v0.21.0
func (*DbUtils) GetHostById ¶ added in v0.21.0
func (*DbUtils) GetIdByVerifyKey ¶ added in v0.21.0
func (*DbUtils) GetInfoByHost ¶ added in v0.21.0
get key by host from x
func (*DbUtils) GetTaskByMd5Password ¶ added in v0.21.0
md5 password
func (*DbUtils) IsHostExist ¶ added in v0.21.0
func (*DbUtils) IsPubClient ¶ added in v0.21.0
func (*DbUtils) UpdateClient ¶ added in v0.21.0
func (*DbUtils) UpdateTask ¶ added in v0.21.0
func (*DbUtils) VerifyUserName ¶ added in v0.21.0
type Host ¶
type Host struct {
Id int
Host string //host
HeaderChange string //header change
HostChange string //host change
Location string //url router
Remark string //remark
Scheme string //http https all
CertFilePath string
KeyFilePath string
NoStore bool
IsClose bool
Flow *Flow
Client *Client
Target *Target //目标
Health `json:"-"`
sync.RWMutex
}
type JsonDb ¶ added in v0.21.0
type JsonDb struct {
Tasks sync.Map
Hosts sync.Map
HostsTmp sync.Map
Clients sync.Map
RunPath string
ClientIncreaseId int32 //client increased id
TaskIncreaseId int32 //task increased id
HostIncreaseId int32 //host increased id
TaskFilePath string //task file path
HostFilePath string //host file path
ClientFilePath string //client file path
}
func (*JsonDb) GetClientId ¶ added in v0.21.0
func (*JsonDb) LoadClientFromJsonFile ¶ added in v0.21.0
func (s *JsonDb) LoadClientFromJsonFile()
func (*JsonDb) LoadHostFromJsonFile ¶ added in v0.21.0
func (s *JsonDb) LoadHostFromJsonFile()
func (*JsonDb) LoadTaskFromJsonFile ¶ added in v0.21.0
func (s *JsonDb) LoadTaskFromJsonFile()
func (*JsonDb) StoreClientsToJsonFile ¶ added in v0.21.0
func (s *JsonDb) StoreClientsToJsonFile()
func (*JsonDb) StoreHostToJsonFile ¶ added in v0.21.0
func (s *JsonDb) StoreHostToJsonFile()
func (*JsonDb) StoreTasksToJsonFile ¶ added in v0.21.0
func (s *JsonDb) StoreTasksToJsonFile()
type MultiAccount ¶ added in v0.24.2
type Pair ¶ added in v0.21.0
type Pair struct {
// contains filtered or unexported fields
}
A data structure to hold a key/value pair.
type PairList ¶ added in v0.21.0
type PairList []*Pair
A slice of Pairs that implements sort.Interface to sort by Value.
type Target ¶ added in v0.21.0
type Target struct {
TargetStr string
TargetArr []string
LocalProxy bool
sync.RWMutex
// contains filtered or unexported fields
}
func (*Target) GetRandomTarget ¶ added in v0.21.0
Click to show internal directories.
Click to hide internal directories.