Update README and Docker documentation to clarify exit codes and error handling. Introduce new error for no data received after MTProxy header in checker logic.
This commit is contained in:
@@ -16,6 +16,10 @@ import (
|
||||
// ErrProxyClosed indicates the MTProxy dropped the TCP connection right after the probe (Telethon #1134 style).
|
||||
var ErrProxyClosed = errors.New("mtproxy closed connection after initial payload")
|
||||
|
||||
// ErrNoDataAfterHeader indicates the proxy accepted the probe but sent no application data back within the wait window.
|
||||
// Treating silence as success matched some servers but often disagrees with Telegram client "unavailable".
|
||||
var ErrNoDataAfterHeader = errors.New("no data from proxy after mtproxy header (timeout)")
|
||||
|
||||
// Check runs the handshake probe for the given parsed secret.
|
||||
func Check(ctx context.Context, host string, port int, parsed *secret.Parsed, dcID int16) error {
|
||||
conn, err := dialTCP(ctx, host, port)
|
||||
@@ -101,5 +105,5 @@ func waitPostPayload(conn net.Conn) error {
|
||||
}
|
||||
}
|
||||
_ = conn.SetReadDeadline(time.Time{})
|
||||
return nil
|
||||
return ErrNoDataAfterHeader
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user