Skip to content

Commit

Permalink
feat: format
Browse files Browse the repository at this point in the history
  • Loading branch information
whxaxes committed Jun 14, 2019
1 parent 7e0d27a commit 18148bb
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions index.js
Expand Up @@ -6,9 +6,7 @@ const debug = require('debug')('tcp-proxy');
const EventEmitter = require('events').EventEmitter;

function genThrough(interceptor, connection) {

return through.obj(function(chunk, enc, done) {

const context = {
client: {
ip: connection.client.address().address,
Expand All @@ -28,7 +26,6 @@ function genThrough(interceptor, connection) {
const result = interceptor(chunk, enc, context);

const handle = data => {

if (data && !Buffer.isBuffer(data)) {
data = Buffer.from(data);
}
Expand All @@ -48,9 +45,7 @@ function genThrough(interceptor, connection) {
} else {
handle();
}

});

}

module.exports = class TCPProxy extends EventEmitter {
Expand Down

0 comments on commit 18148bb

Please sign in to comment.