We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5bbd796 commit c225170Copy full SHA for c225170
source.js
@@ -13,11 +13,17 @@ module.exports = function(socket, cb) {
13
var ended;
14
var started = false;
15
socket.addEventListener('message', function(evt) {
16
+ var data = evt.data;
17
+
18
+ if (data instanceof ArrayBuffer) {
19
+ data = new Buffer(data);
20
+ }
21
22
if (receiver) {
- return receiver(null, evt.data);
23
+ return receiver(null, data);
24
}
25
- buffer.push(evt.data);
26
+ buffer.push(data);
27
});
28
29
socket.addEventListener('close', function(evt) {
@@ -71,7 +77,3 @@ module.exports = function(socket, cb) {
71
77
72
78
return read;
73
79
};
74
-
75
76
0 commit comments