diff --git a/lib.js b/lib.js index 0e84ee8..366d8dd 100644 --- a/lib.js +++ b/lib.js @@ -7,14 +7,14 @@ class TunnelRequest extends stream.Readable { this._requestId = requestId; const onRequestPipe = (requestId, data) => { - console.log("Res pipe size", data.length) + console.log("Res pipe size", data.length); if (this._requestId === requestId) { this.push(data); } }; const onRequestPipes = (requestId, data) => { - console.log("Res pipes size", data.length) + // console.log("Res pipes size", data.length) if (this._requestId === requestId) { data.forEach((chunk) => { this.push(chunk); @@ -108,14 +108,16 @@ class TunnelResponse extends stream.Duplex { } _write(chunk, encoding, callback) { - console.log("Res Write Chunk: ", chunk.length); + console.log("Res Write Chunk: ", chunk.length, encoding); this._socket.emit("response-pipe", this._responseId, chunk); this._socket.io.engine.once("drain", () => { + console.log("hello = ", "callback...") callback(); }); } _writev(chunks, callback) { + console.log("Res Write Chunks: ", chunks.length); this._socket.emit("response-pipes", this._responseId, chunks); this._socket.io.engine.once("drain", () => { callback();