vssh 3.6.7__tar.gz → 3.6.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vssh-3.6.7/vssh.egg-info → vssh-3.6.8}/PKG-INFO +1 -1
- {vssh-3.6.7 → vssh-3.6.8}/pyproject.toml +1 -1
- {vssh-3.6.7 → vssh-3.6.8/vssh.egg-info}/PKG-INFO +1 -1
- {vssh-3.6.7 → vssh-3.6.8}/vssh.py +20 -2
- {vssh-3.6.7 → vssh-3.6.8}/LICENSE +0 -0
- {vssh-3.6.7 → vssh-3.6.8}/README.md +0 -0
- {vssh-3.6.7 → vssh-3.6.8}/setup.cfg +0 -0
- {vssh-3.6.7 → vssh-3.6.8}/vssh.egg-info/SOURCES.txt +0 -0
- {vssh-3.6.7 → vssh-3.6.8}/vssh.egg-info/dependency_links.txt +0 -0
- {vssh-3.6.7 → vssh-3.6.8}/vssh.egg-info/entry_points.txt +0 -0
- {vssh-3.6.7 → vssh-3.6.8}/vssh.egg-info/top_level.txt +0 -0
- {vssh-3.6.7 → vssh-3.6.8}/vssh_mcp_server.py +0 -0
- {vssh-3.6.7 → vssh-3.6.8}/vssh_p2p.py +0 -0
|
@@ -4030,9 +4030,27 @@ Env: VSSH_SECRET
|
|
|
4030
4030
|
|
|
4031
4031
|
online = 0
|
|
4032
4032
|
total = 0
|
|
4033
|
-
#
|
|
4033
|
+
# Pre-warm WireGuard tunnels BEFORE status checks.
|
|
4034
|
+
# Fires short-timeout TCP probes to all peers simultaneously → triggers
|
|
4035
|
+
# WireGuard handshakes, then waits 1.2 s for them to finish.
|
|
4036
|
+
# By the time real checks run, all tunnels are warm → zero handshakes
|
|
4037
|
+
# during status → no disruption of the caller's active session.
|
|
4038
|
+
_peer_ips = [ip for ip in _servers.values() if ip and ip != _my_vpn_ip]
|
|
4039
|
+
def _prewarm(ip):
|
|
4040
|
+
try:
|
|
4041
|
+
_pw = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
4042
|
+
_pw.settimeout(0.15)
|
|
4043
|
+
_pw.connect((ip, PORT))
|
|
4044
|
+
_pw.close()
|
|
4045
|
+
except Exception:
|
|
4046
|
+
pass
|
|
4047
|
+
with concurrent.futures.ThreadPoolExecutor(max_workers=len(_peer_ips) or 1) as _wp:
|
|
4048
|
+
list(_wp.map(_prewarm, _peer_ips))
|
|
4049
|
+
time.sleep(1.2) # wait for WireGuard handshakes to complete
|
|
4050
|
+
|
|
4051
|
+
# Run checks in parallel for speed — tunnels are warm, no handshakes
|
|
4034
4052
|
results = []
|
|
4035
|
-
with concurrent.futures.ThreadPoolExecutor(max_workers=
|
|
4053
|
+
with concurrent.futures.ThreadPoolExecutor(max_workers=14) as pool:
|
|
4036
4054
|
futures = {pool.submit(_check_node, n, ip): n for n, ip in sorted(_servers.items()) if ip}
|
|
4037
4055
|
for f in concurrent.futures.as_completed(futures):
|
|
4038
4056
|
results.append(f.result())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|