From 1339ac2bc91273447c61425c2c273dea5ec3f2b7 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Sat, 12 Nov 2016 17:45:37 +0100 Subject: [PATCH] More debug logging for websockets --- resources/lib/websocket_client.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/lib/websocket_client.py b/resources/lib/websocket_client.py index 3596789e..b0a6512e 100644 --- a/resources/lib/websocket_client.py +++ b/resources/lib/websocket_client.py @@ -84,16 +84,17 @@ class WebSocket(threading.Thread): # Need to use plex.tv token, if any. NOT user token token = window('plex_token') # Get the appropriate prefix for the websocket - if "https" in server: - server = server.replace('https', "wss") + if server.startswith('https'): + server = "wss%s" % server[5:] else: - server = server.replace('http', "ws") + server = "ws%s" % server[4:] uri = "%s/:/websockets/notifications" % server if token: uri += '?X-Plex-Token=%s' % token sslopt = {} if settings('sslverify') == "false": sslopt["cert_reqs"] = ssl.CERT_NONE + log.debug("Uri: %s, sslopt: %s" % (uri, sslopt)) return uri, sslopt def run(self):