More debug logging for websockets

This commit is contained in:
tomkat83 2016-11-12 17:45:37 +01:00
parent 3b22cb41a0
commit 1339ac2bc9

View file

@ -84,16 +84,17 @@ class WebSocket(threading.Thread):
# Need to use plex.tv token, if any. NOT user token # Need to use plex.tv token, if any. NOT user token
token = window('plex_token') token = window('plex_token')
# Get the appropriate prefix for the websocket # Get the appropriate prefix for the websocket
if "https" in server: if server.startswith('https'):
server = server.replace('https', "wss") server = "wss%s" % server[5:]
else: else:
server = server.replace('http', "ws") server = "ws%s" % server[4:]
uri = "%s/:/websockets/notifications" % server uri = "%s/:/websockets/notifications" % server
if token: if token:
uri += '?X-Plex-Token=%s' % token uri += '?X-Plex-Token=%s' % token
sslopt = {} sslopt = {}
if settings('sslverify') == "false": if settings('sslverify') == "false":
sslopt["cert_reqs"] = ssl.CERT_NONE sslopt["cert_reqs"] = ssl.CERT_NONE
log.debug("Uri: %s, sslopt: %s" % (uri, sslopt))
return uri, sslopt return uri, sslopt
def run(self): def run(self):