mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-10 23:42:37 -07:00
Allow manual entry of QR code server address
This commit is contained in:
parent
1c8e581cf1
commit
be2989ead1
2 changed files with 36 additions and 6 deletions
|
@ -4775,9 +4775,18 @@ class WebInterface(object):
|
|||
else:
|
||||
scheme = 'http'
|
||||
|
||||
# Have to return some hostname if socket fails even if 127.0.0.1 won't work
|
||||
hostname = '127.0.0.1'
|
||||
|
||||
if plexpy.CONFIG.HTTP_HOST == '0.0.0.0':
|
||||
import socket
|
||||
hostname = socket.gethostbyname(socket.gethostname())
|
||||
try:
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
|
||||
s.connect(('<broadcast>', 0))
|
||||
hostname = s.getsockname()[0]
|
||||
except socket.error:
|
||||
hostname = socket.gethostbyname(socket.gethostname())
|
||||
else:
|
||||
hostname = plexpy.CONFIG.HTTP_HOST
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue