mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
1 parent
3ff0f8b7ab
commit
efa6f6560c
7 files changed
+59
-12
No files matched your search
@@ -1,5 +1,7 @@
|
||||
"""dnspr: a caching DNS proxy, answering from what it has been told."""
|
||||
|
||||
import time
|
||||
|
||||
|
||||
def run(t):
|
||||
port = t.free_port()
|
||||
@@ -15,8 +17,11 @@ def run(t):
|
||||
allow *
|
||||
dnspr -p{port}
|
||||
""")
|
||||
# wait for the service: a datagram sent too early is simply lost
|
||||
for _ in range(100):
|
||||
# Wait for the service: a datagram sent too early is simply lost. Bound
|
||||
# by the clock, not by a number of attempts, so a server that answers
|
||||
# nothing costs seconds rather than minutes.
|
||||
deadline = time.time() + 5
|
||||
while time.time() < deadline:
|
||||
if t.dns_query(port, "host.test"):
|
||||
break
|
||||
|
||||
|
||||
Reference in new issue
Block a user