Skip to content

Commit

Permalink
fix pac
Browse files Browse the repository at this point in the history
  • Loading branch information
dollarkillerx committed Oct 11, 2021
1 parent f580ef6 commit 3c4f071
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func (s *server) handleClientRequest(client net.Conn) {
//log.Println(err)
return
}

if b[0] == 0x05 { //只处理Socket5协议
//客户端回应:Socket服务端不需要验证方式
client.Write([]byte{0x05, 0x00})
Expand Down Expand Up @@ -201,7 +202,6 @@ func usePac(host string, pac bool, website bool, dns string) bool {
if !pac {
return false
}

var ip string

rb, err := storage.Storage.Get(host)
Expand All @@ -222,13 +222,16 @@ func usePac(host string, pac bool, website bool, dns string) bool {
}
}
}

if len(lookupIP) > 0 {
ip = lookupIP[0]
} else if len(ip) == 0 {
return false
}

storage.Storage.Set(host, ip)
} else {
ip = host
}
} else {
ip = rb.(string)
Expand Down

0 comments on commit 3c4f071

Please sign in to comment.