new feature multi user auth with socks5

This commit is contained in:
zhangwei
2019-09-12 08:22:12 +08:00
parent 5e55b761cf
commit a05995fba5
4 changed files with 15 additions and 12 deletions

View File

@@ -25,12 +25,10 @@ func (s *Flow) Add(in, out int64) {
}
type Config struct {
U string
P string
Compress bool
Crypt bool
MultiUser bool // enable multi user authentication.
MultiUserMap map[string]string // multi user and pwd
U string
P string
Compress bool
Crypt bool
}
type Client struct {
@@ -142,6 +140,7 @@ type Tunnel struct {
LocalPath string
StripPre string
Target *Target
MultiUser *MultiUser
Health
sync.RWMutex
}
@@ -186,6 +185,10 @@ type Target struct {
sync.RWMutex
}
type MultiUser struct {
UserMap map[string]string // multi user and pwd
}
func (s *Target) GetRandomTarget() (string, error) {
if s.TargetArr == nil {
s.TargetArr = strings.Split(s.TargetStr, "\n")