Add support for private IP range 10.0.0.0-10.255.255.255 (#10)

This commit is contained in:
redphx 2022-04-24 12:01:45 +07:00 committed by GitHub
parent 874145f2a5
commit 23dac08e45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View file

@ -149,6 +149,7 @@ class JoyDance:
''' Open a port on this machine so the console can connect to it '''
try:
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.settimeout(10)
conn.bind(('0.0.0.0', self.host_port))
conn.listen(5)
@ -382,7 +383,7 @@ class JoyDance:
if self.tls_certificate:
ssl_context.load_verify_locations(cadata=self.tls_certificate)
if '192.168' in self.pairing_url:
if self.pairing_url.startswith('192.168.') or self.pairing_url.startswith('10.'):
if self.console_conn:
server_hostname = self.console_conn.getpeername()[0]
else: