Fix wsproxy to be compatible with node.js v0.10.x
diff --git a/wsproxy/wsproxy-tcp.js b/wsproxy/wsproxy-tcp.js
index 7bdb1c9..8ff84a2 100644
--- a/wsproxy/wsproxy-tcp.js
+++ b/wsproxy/wsproxy-tcp.js
@@ -56,7 +56,7 @@
if (LOG > 1) console.log("Message from clinet: " + message);
}
else if (typeof message == 'object') {
- var bytesView = new Uint8Array(message);
+ var bytesView = new Buffer(message);
if (LOG > 1) {
var logMsg = 'Byte array from client: ';
@@ -66,7 +66,7 @@
}
if (sock_ready) {
- sock.write(bytesView.buffer);
+ sock.write(bytesView);
} else {
send_queue.push(message);
}
@@ -90,7 +90,7 @@
sock.on('data', function(data) {
if (typeof data == 'object') {
- var bytesView = new Uint8Array(data);
+ var bytesView = new Buffer(data);
if (LOG > 1) {
console.log('Byte array from server: ');
@@ -101,7 +101,7 @@
}
if (ws_ready == true) {
- ws.send(bytesView.buffer, {binary: true, mask: false});
+ ws.send(bytesView, {binary: true, mask: false});
}
}
});