Browse Source

More information when vmess auth fails.

V2Ray 10 years ago
parent
commit
a51d64a102
2 changed files with 6 additions and 1 deletions
  1. 1 1
      common/log/log.go
  2. 5 0
      proxy/vmess/vmessout.go

+ 1 - 1
common/log/log.go

@@ -31,7 +31,7 @@ func writeLog(level LogLevel, prefix, format string, v ...interface{}) string {
 	} else {
 		data = fmt.Sprintf(format, v...)
 	}
-	log.Print(prefix + data)
+	log.Println(prefix + data)
 	return data
 }
 

+ 5 - 0
proxy/vmess/vmessout.go

@@ -15,6 +15,10 @@ import (
 	"github.com/v2ray/v2ray-core/proxy/vmess/protocol/user"
 )
 
+const (
+	InfoTimeNotSync = "Please check the User ID in your vmess configuration, and make sure the time on your local and remote server are in sync."
+)
+
 // VNext is the next Point server in the connection chain.
 type VNextServer struct {
 	Destination v2net.Destination // Address of VNext server
@@ -145,6 +149,7 @@ func handleResponse(conn *net.TCPConn, request *protocol.VMessRequest, output ch
 	nBytes, err := decryptResponseReader.Read(response[:])
 	if err != nil {
 		log.Error("VMessOut: Failed to read VMess response (%d bytes): %v", nBytes, err)
+		log.Error(InfoTimeNotSync)
 		return
 	}
 	if !bytes.Equal(response[:], request.ResponseHeader[:]) {