3 Commits

Author SHA1 Message Date
lyc8503
1696b74763 Merge pull request #16 from i-Pear/main
fix unexpected EOF: Prevent client from being garbage collected
2023-01-25 13:08:53 +08:00
i.Pear
fd0217e446 Prevent client from being garbage collected 2023-01-25 04:19:40 +08:00
lyc8503
a7fa8c3656 fix sms code bug 2023-01-25 00:45:30 +08:00
2 changed files with 4 additions and 1 deletions

View File

@@ -121,7 +121,7 @@ func WebLogin(server string, username string, password string) (string, error) {
n, _ := resp.Body.Read(buf)
defer resp.Body.Close()
if !strings.Contains(string(buf[:n]), "验证码已发送到您的手机") {
if !strings.Contains(string(buf[:n]), "验证码已发送到您的手机") && !strings.Contains(string(buf[:n]), "<USER_PHONE>") {
debug.PrintStack()
return "", errors.New("unexpected sms resp: " + string(buf[:n]))
}

View File

@@ -5,6 +5,7 @@ import (
"flag"
"fmt"
"log"
"runtime"
)
func main() {
@@ -51,4 +52,6 @@ func main() {
log.Printf("Login success, your IP: %d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3])
client.ServeSocks5(socksBind, debugDump)
runtime.KeepAlive(client)
}