mcollina / msgpack5

A msgpack v5 implementation for node.js, with extension points / msgpack.org[Node]
MIT License
492 stars 76 forks source link

how to use on Browser of client #27

Closed ibeeger closed 9 years ago

ibeeger commented 9 years ago

qq20150704-1 2x

var ss = {a:1,b:2} // res.send({a:1}) res.set("Content-Type","application/msgpack"); console.log(msg.encode(ss)); res.end(msg.encode(ss));

how can i get this data on client ?

mcollina commented 9 years ago

You have to transfer the data as binary: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data