Update MTProxy checker documentation and logic to clarify probing modes and improve error handling. Modify README and Docker documentation to reflect changes in the -probe flag behavior, including detailed descriptions of exit codes and timeout handling. Refactor connection handling to enhance robustness and align with Telethon's approach.
This commit is contained in:
@@ -81,10 +81,14 @@ func InitHeader(secret16 []byte, dcID int16) (header64 []byte, enc cipher.Stream
|
||||
binary.LittleEndian.PutUint16(dcBytes, uint16(dcID))
|
||||
copy(buf[60:62], dcBytes)
|
||||
|
||||
encChunk := make([]byte, 8)
|
||||
copy(encChunk, buf[56:64])
|
||||
enc.XORKeyStream(encChunk, encChunk)
|
||||
copy(buf[56:64], encChunk)
|
||||
// Как в Telethon MTProxyIO.init_header: encrypt(bytes(random)) на всём 64-байтном буфере,
|
||||
// на провод уходит только random[0:56] как есть и random[56:64] = out[56:64].
|
||||
// CTR enc должен продвинуться на 64 байта — иначе req_pq и чтение DC расходятся с прокси.
|
||||
work := make([]byte, 64)
|
||||
copy(work, buf)
|
||||
out := make([]byte, 64)
|
||||
enc.XORKeyStream(out, work)
|
||||
copy(buf[56:64], out[56:64])
|
||||
|
||||
return buf, enc, dec, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user