From 384598fbcc5c8114b7b133dba4ae443fffe71600 Mon Sep 17 00:00:00 2001 From: lilia Date: Wed, 7 Sep 2016 21:56:18 -0700 Subject: [PATCH] Log websocket urls // FREEBIE --- js/libtextsecure.js | 11 ++++++----- libtextsecure/api.js | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 2e69b19dc..959e94094 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -37849,19 +37849,20 @@ var TextSecureServer = (function() { }.bind(this)); }, getMessageSocket: function() { + var url = this.getUrl(); + console.log('opening message socket', url); return new WebSocket( - this.getUrl().replace('https://', 'wss://') - .replace('http://', 'ws://') + url.replace('https://', 'wss://').replace('http://', 'ws://') + '/v1/websocket/?login=' + encodeURIComponent(this.username) + '&password=' + encodeURIComponent(this.password) + '&agent=OWD' ); }, getProvisioningSocket: function () { - console.log('opening provisioning socket', this.url); + var url = this.getUrl(); + console.log('opening provisioning socket', url); return new WebSocket( - this.getUrl().replace('https://', 'wss://') - .replace('http://', 'ws://') + url.replace('https://', 'wss://').replace('http://', 'ws://') + '/v1/websocket/provisioning/?agent=OWD' ); } diff --git a/libtextsecure/api.js b/libtextsecure/api.js index 0a08bd846..8f0a98346 100644 --- a/libtextsecure/api.js +++ b/libtextsecure/api.js @@ -377,19 +377,20 @@ var TextSecureServer = (function() { }.bind(this)); }, getMessageSocket: function() { + var url = this.getUrl(); + console.log('opening message socket', url); return new WebSocket( - this.getUrl().replace('https://', 'wss://') - .replace('http://', 'ws://') + url.replace('https://', 'wss://').replace('http://', 'ws://') + '/v1/websocket/?login=' + encodeURIComponent(this.username) + '&password=' + encodeURIComponent(this.password) + '&agent=OWD' ); }, getProvisioningSocket: function () { - console.log('opening provisioning socket', this.url); + var url = this.getUrl(); + console.log('opening provisioning socket', url); return new WebSocket( - this.getUrl().replace('https://', 'wss://') - .replace('http://', 'ws://') + url.replace('https://', 'wss://').replace('http://', 'ws://') + '/v1/websocket/provisioning/?agent=OWD' ); }