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.
Publish mtproxy_checker Docker image / test (push) Successful in 7s
Publish mtproxy_checker Docker image / build-and-push (push) Successful in 52s

This commit is contained in:
Denozordec
2026-04-11 14:16:11 +07:00
parent 935401b1f8
commit a846ef5373
9 changed files with 45 additions and 31 deletions
+8 -4
View File
@@ -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
}