Commit 6af884c4 by ken

depth

parent 7bb9a793
...@@ -99,11 +99,11 @@ const _subscribe = function(callback, opened_callback = false) { ...@@ -99,11 +99,11 @@ const _subscribe = function(callback, opened_callback = false) {
ws.on('close', _handleSocketClose.bind(ws)); ws.on('close', _handleSocketClose.bind(ws));
ws.on('message', function(data) { ws.on('message', function(data) {
try { try {
console.log(data); const text = pako.inflate(data, {
data = pako.inflate(data, {
to: 'string' to: 'string'
}); });
callback(JSON.parse(data)); console.log(text);
callback(JSON.parse(text));
} catch (error) { } catch (error) {
console.log('Parse error: '+error.message); console.log('Parse error: '+error.message);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment