Add TCP ping fallback for servers that block ICMP (XRay, VLESS, Reality)

Made-with: Cursor
This commit is contained in:
anten-ka
2026-03-07 15:08:58 +03:00
parent ee13a9e512
commit f4dc06b09c
3 changed files with 119 additions and 7 deletions

23
_ssh_debug.py Normal file
View File

@@ -0,0 +1,23 @@
import paramiko, sys
host = "185.250.47.205"
user = "root"
pwd = "0i1sbf9NM36FkG5dFH"
def run(cmd, timeout=30):
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(host, username=user, password=pwd, timeout=10)
stdin, stdout, stderr = ssh.exec_command(cmd, timeout=timeout)
out = stdout.read().decode(errors="replace")
err = stderr.read().decode(errors="replace")
rc = stdout.channel.recv_exit_status()
ssh.close()
return rc, out, err
if __name__ == "__main__":
cmd = " ".join(sys.argv[1:]) if len(sys.argv) > 1 else "echo ok"
rc, out, err = run(cmd)
if out: print(out, end="")
if err: print("STDERR:", err, end="")
print(f"\n[exit {rc}]")