Skip to content

Commit

Permalink
Release 1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
whxaxes committed Sep 8, 2017
1 parent c28ef22 commit 4224839
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ module.exports = class TCPProxy extends EventEmitter {
server.destroy();
interceptorClient && interceptorClient.end();
interceptorServer && interceptorServer.end();
this.server && this.server.removeListener('close', onClose);
this.removeListener('close', onClose);
};

server.once('close', onClose);
server.once('error', onClose);
client.once('close', onClose);
client.once('error', onClose);
this.server.once('close', onClose);
this.once('close', onClose);
})
.listen(proxyPort);

Expand All @@ -107,6 +107,7 @@ module.exports = class TCPProxy extends EventEmitter {
}

return new Promise(resolve => {
this.emit('close');
this.server.close(() => {
this.server = null;
resolve();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tcp-proxy.js",
"version": "1.0.4",
"version": "1.0.5",
"description": "simple tcp proxy",
"dependencies": {
"through2": "^2.0.3"
Expand Down

0 comments on commit 4224839

Please sign in to comment.