port_matrix.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. """Systematic port matrix: 3 gateway IPs x game ports (8001/8021/8041/8061/8081/12000).
  2. Key insight from cached srvlist: 玖扬 servers have proxy= EMPTY, meaning the
  3. client connects DIRECTLY to the game port — only some servers use the 12000
  4. proxy. Earlier Test-NetConnection said 8001 closed, but asyncio connects
  5. succeeded to 12000. Test-NetConnection may behave differently (ICMP/SYN
  6. handling) — re-verify with real asyncio TCP connects.
  7. """
  8. import asyncio
  9. IPS = ["47.118.169.147", "47.118.169.153", "47.118.172.233"]
  10. PORTS = [8001, 8021, 8041, 8061, 8081, 12000]
  11. async def test(ip: str, port: int) -> bool:
  12. try:
  13. r, w = await asyncio.wait_for(asyncio.open_connection(ip, port), timeout=4)
  14. w.close()
  15. try:
  16. await w.wait_closed()
  17. except Exception:
  18. pass
  19. return True
  20. except Exception:
  21. return False
  22. async def main():
  23. print(f"{'ip':>16} " + " ".join(f"{p:>6}" for p in PORTS))
  24. for ip in IPS:
  25. results = await asyncio.gather(*(test(ip, p) for p in PORTS))
  26. marks = " ".join(f"{'OPEN' if o else ' - '}" for o in results)
  27. print(f"{ip:>16} {marks}")
  28. print()
  29. print("If 8001/8081 are OPEN: 玖扬 servers are DIRECT-connect (no proxy);")
  30. print("our probes to 12000 with p3=8001 were asking the PROXY to reach a")
  31. print("different backend — hence silence.")
  32. asyncio.run(main())