mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 03:16:53 +00:00
new feature multi user auth with socks5
This commit is contained in:
@@ -239,15 +239,15 @@ func dealTunnel(s string) *file.Tunnel {
|
||||
t.LocalPath = item[1]
|
||||
case "strip_pre":
|
||||
t.StripPre = item[1]
|
||||
case "multi_user":
|
||||
t.MultiUser = new(file.MultiUser)
|
||||
case "multi_account":
|
||||
t.MultiAccount = &file.MultiAccount{}
|
||||
if b, err := common.ReadAllFromFile(item[1]); err != nil {
|
||||
panic(err)
|
||||
} else {
|
||||
if content, err := common.ParseStr(string(b)); err != nil {
|
||||
panic(err)
|
||||
} else {
|
||||
t.MultiUser.UserMap = dealMultiUser(content)
|
||||
t.MultiAccount.AccountMap = dealMultiUser(content)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -124,23 +124,23 @@ func (s *Client) HasHost(h *Host) bool {
|
||||
}
|
||||
|
||||
type Tunnel struct {
|
||||
Id int
|
||||
Port int
|
||||
ServerIp string
|
||||
Mode string
|
||||
Status bool
|
||||
RunStatus bool
|
||||
Client *Client
|
||||
Ports string
|
||||
Flow *Flow
|
||||
Password string
|
||||
Remark string
|
||||
TargetAddr string
|
||||
NoStore bool
|
||||
LocalPath string
|
||||
StripPre string
|
||||
Target *Target
|
||||
MultiUser *MultiUser
|
||||
Id int
|
||||
Port int
|
||||
ServerIp string
|
||||
Mode string
|
||||
Status bool
|
||||
RunStatus bool
|
||||
Client *Client
|
||||
Ports string
|
||||
Flow *Flow
|
||||
Password string
|
||||
Remark string
|
||||
TargetAddr string
|
||||
NoStore bool
|
||||
LocalPath string
|
||||
StripPre string
|
||||
Target *Target
|
||||
MultiAccount *MultiAccount
|
||||
Health
|
||||
sync.RWMutex
|
||||
}
|
||||
@@ -185,8 +185,8 @@ type Target struct {
|
||||
sync.RWMutex
|
||||
}
|
||||
|
||||
type MultiUser struct {
|
||||
UserMap map[string]string // multi user and pwd
|
||||
type MultiAccount struct {
|
||||
AccountMap map[string]string // multi account and pwd
|
||||
}
|
||||
|
||||
func (s *Target) GetRandomTarget() (string, error) {
|
||||
|
Reference in New Issue
Block a user