File mode|pubVkey optimization

This commit is contained in:
刘河
2019-03-02 17:43:21 +08:00
parent f526c56784
commit 1c1aa5ec5b
29 changed files with 477 additions and 195 deletions

View File

@@ -77,6 +77,24 @@ func (s *Client) GetConn() bool {
return false
}
func (s *Client) HasTunnel(t *Tunnel) bool {
for _, v := range GetCsvDb().Tasks {
if v.Client.Id == s.Id && v.Port == t.Port {
return true
}
}
return false
}
func (s *Client) HasHost(h *Host) bool {
for _, v := range GetCsvDb().Hosts {
if v.Client.Id == s.Id && v.Host == h.Host && h.Location == v.Location {
return true
}
}
return false
}
type Tunnel struct {
Id int //Id
Port int //服务端监听端口
@@ -91,6 +109,8 @@ type Tunnel struct {
Remark string //备注
TargetAddr string
NoStore bool
LocalPath string
StripPre string
}
type Config struct {