the data returned by websocket is in gzip format. How to decompress it?
function ws (url) {
var ws = new WebSocket(url);
ws.onopen = function(evt){
console.log(evt);
};
ws.onmessage = function(evt){
console.log(evt);
};
ws.onerror = function(evt){
console.log(evt);
}
}
ws ("wss://api.huobi.br.com/market/tickers");
the printed evt looks like this
data is a Blob object.
looked up the information on the Internet and said that it can be decompressed by using the pako.inflate () method in pakojs, but I reported an error after using it:
Uncaught unknown compression method
/ / unknown compression method
so I don"t know how to decompress it.