Documentation ¶
Index ¶
- type Client
- type Config
- type Csv
- func (s *Csv) DelClient(id int) error
- func (s *Csv) DelHost(id int) error
- func (s *Csv) DelTask(id int) error
- func (s *Csv) GetClient(id int) (c *Client, err error)
- func (s *Csv) GetClientId() int32
- func (s *Csv) GetClientIdByVkey(vkey string) (id int, err error)
- func (s *Csv) GetClientList(start, length int, search string, clientId int) ([]*Client, int)
- func (s *Csv) GetHost(start, length int, id int, search string) ([]*Host, int)
- func (s *Csv) GetHostById(id int) (h *Host, err error)
- func (s *Csv) GetHostId() int32
- func (s *Csv) GetIdByVerifyKey(vKey string, addr string) (id int, err error)
- func (s *Csv) GetInfoByHost(host string, r *http.Request) (h *Host, err error)
- func (s *Csv) GetMapLen(m sync.Map) int
- func (s *Csv) GetTask(id int) (t *Tunnel, err error)
- func (s *Csv) GetTaskByMd5Password(p string) (t *Tunnel)
- func (s *Csv) GetTaskId() int32
- func (s *Csv) IsHostExist(h *Host) bool
- func (s *Csv) IsPubClient(id int) bool
- func (s *Csv) LoadClientFromCsv()
- func (s *Csv) LoadHostFromCsv()
- func (s *Csv) LoadTaskFromCsv()
- func (s *Csv) NewClient(c *Client) error
- func (s *Csv) NewHost(t *Host) error
- func (s *Csv) NewTask(t *Tunnel) (err error)
- func (s *Csv) StoreClientsToCsv()
- func (s *Csv) StoreHostToCsv()
- func (s *Csv) StoreTasksToCsv()
- func (s *Csv) UpdateClient(t *Client) error
- func (s *Csv) UpdateTask(t *Tunnel) error
- func (s *Csv) VerifyVkey(vkey string, id int) (res bool)
- type Flow
- type Health
- type Host
- type Tunnel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Cnf *Config Id int //id VerifyKey string //验证密钥 Addr string //客户端ip地址 Remark string //备注 Status bool //是否开启 IsConnect bool //是否连接 RateLimit int //速度限制 /kb Flow *Flow //流量 Rate *rate.Rate //速度控制 NoStore bool NoDisplay bool MaxConn int //客户端最大连接数 NowConn int //当前连接数 ConfigConnAllow bool sync.RWMutex // contains filtered or unexported fields }
func (*Client) ModifyTarget ¶ added in v0.18.1
func (s *Client) ModifyTarget()
modify the hosts and the tunnels by health information
type Csv ¶
type Csv struct { Tasks sync.Map Hosts sync.Map //域名列表 HostsTmp sync.Map Clients sync.Map //客户端 RunPath string //存储根目录 ClientIncreaseId int32 //客户端id TaskIncreaseId int32 //任务自增ID HostIncreaseId int32 //host increased id }
var (
CsvDb *Csv
)
func (*Csv) GetClientId ¶
func (*Csv) GetClientIdByVkey ¶ added in v0.0.15
func (*Csv) GetClientList ¶
func (*Csv) GetIdByVerifyKey ¶
func (*Csv) GetInfoByHost ¶ added in v0.0.15
get key by host from x
func (*Csv) GetTaskByMd5Password ¶ added in v0.18.0
md5 password
func (*Csv) IsHostExist ¶ added in v0.0.15
func (*Csv) IsPubClient ¶ added in v0.20.1
func (*Csv) LoadClientFromCsv ¶
func (s *Csv) LoadClientFromCsv()
func (*Csv) LoadHostFromCsv ¶
func (s *Csv) LoadHostFromCsv()
func (*Csv) LoadTaskFromCsv ¶
func (s *Csv) LoadTaskFromCsv()
func (*Csv) StoreClientsToCsv ¶
func (s *Csv) StoreClientsToCsv()
func (*Csv) StoreHostToCsv ¶
func (s *Csv) StoreHostToCsv()
func (*Csv) StoreTasksToCsv ¶
func (s *Csv) StoreTasksToCsv()
func (*Csv) UpdateClient ¶
func (*Csv) UpdateTask ¶
type Flow ¶
type Host ¶
type Host struct { Id int Host string //启动方式 Target string //目标 HeaderChange string //host修改 HostChange string //host修改 Location string //url 路由 Flow *Flow Client *Client Remark string //备注 NowIndex int TargetArr []string NoStore bool Scheme string //http https all IsClose bool Health sync.RWMutex }
func (*Host) GetRandomTarget ¶
type Tunnel ¶
type Tunnel struct { Id int //Id Port int //服务端监听端口 ServerIp string Mode string //启动方式 Target string //目标 TargetArr []string //目标 Status bool //设置是否开启 RunStatus bool //当前运行状态 Client *Client //所属客户端id Ports string //客户端与服务端传递 Flow *Flow Password string //私密模式密码,唯一 Remark string //备注 TargetAddr string NoStore bool LocalPath string StripPre string NowIndex int Health sync.RWMutex }
func (*Tunnel) GetRandomTarget ¶ added in v0.18.1
Click to show internal directories.
Click to hide internal directories.