P2p first version

This commit is contained in:
刘河
2019-02-26 22:40:28 +08:00
parent 204c53ddd3
commit 534d428c6d
23 changed files with 986 additions and 77 deletions

View File

@@ -18,6 +18,7 @@ type CommonConfig struct {
Client *file.Client
}
type LocalServer struct {
Type string
Port int
Password string
}
@@ -53,7 +54,15 @@ func NewConfig(path string) (c *Config, err error) {
nowContent = c.content[nowIndex:nextIndex]
if strings.Index(getTitleContent(c.title[i]), "secret") == 0 {
c.LocalServer = append(c.LocalServer, delLocalService(nowContent))
local := delLocalService(nowContent)
local.Type = "secret"
c.LocalServer = append(c.LocalServer, local)
continue
}
if strings.Index(getTitleContent(c.title[i]), "p2p") == 0 {
local := delLocalService(nowContent)
local.Type = "p2p"
c.LocalServer = append(c.LocalServer, local)
continue
}
switch c.title[i] {