Add more websocket debug logging

// FREEBIE
This commit is contained in:
lilia 2015-09-20 00:30:21 -07:00
parent f70e844cef
commit 823f570955
2 changed files with 10 additions and 0 deletions

View file

@ -39400,6 +39400,7 @@ function generateKeys(count, progressCallback) {
if (this.socket && this.socket.readyState !== WebSocket.CLOSED) {
this.socket.close();
}
console.log('opening websocket');
this.socket = new WebSocket(
this.url.replace('https://', 'wss://').replace('http://', 'ws://')
+ '/v1/websocket/?login=' + encodeURIComponent(this.username)
@ -39408,6 +39409,7 @@ function generateKeys(count, progressCallback) {
this.socket.onclose = this.onclose.bind(this);
this.socket.onerror = this.onerror.bind(this);
this.socket.onconnect = this.onconnect.bind(this);
this.wsr = new WebSocketResource(this.socket, {
handleRequest: this.handleRequest.bind(this),
keepalive: { path: '/v1/keepalive', disconnect: true }
@ -39417,6 +39419,9 @@ function generateKeys(count, progressCallback) {
this.socket.close();
delete this.listeners;
},
onconnect: function() {
console.log('websocket connected');
},
onerror: function(error) {
console.log('websocket error', error);
this.socketError = error;

View file

@ -25,6 +25,7 @@
if (this.socket && this.socket.readyState !== WebSocket.CLOSED) {
this.socket.close();
}
console.log('opening websocket');
this.socket = new WebSocket(
this.url.replace('https://', 'wss://').replace('http://', 'ws://')
+ '/v1/websocket/?login=' + encodeURIComponent(this.username)
@ -33,6 +34,7 @@
this.socket.onclose = this.onclose.bind(this);
this.socket.onerror = this.onerror.bind(this);
this.socket.onconnect = this.onconnect.bind(this);
this.wsr = new WebSocketResource(this.socket, {
handleRequest: this.handleRequest.bind(this),
keepalive: { path: '/v1/keepalive', disconnect: true }
@ -42,6 +44,9 @@
this.socket.close();
delete this.listeners;
},
onconnect: function() {
console.log('websocket connected');
},
onerror: function(error) {
console.log('websocket error', error);
this.socketError = error;