mirror of
https://github.com/YunoHost/check-http.git
synced 2024-09-03 19:56:42 +02:00
commit
6216deb5cc
1 changed files with 4 additions and 1 deletions
|
@ -59,6 +59,9 @@ def check_rate_limit(key, now):
|
||||||
|
|
||||||
async def check_port_is_open(ip, port):
|
async def check_port_is_open(ip, port):
|
||||||
|
|
||||||
|
if ":" in ip:
|
||||||
|
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
|
||||||
|
else:
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
sock.settimeout(2)
|
sock.settimeout(2)
|
||||||
result = sock.connect_ex((ip, port))
|
result = sock.connect_ex((ip, port))
|
||||||
|
|
Loading…
Reference in a new issue