Skip to content

Commit

Permalink
end sockets instead of destroying them
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKhanj committed Dec 20, 2023
1 parent cd723a4 commit 6077bd8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "moxyjs",
"version": "0.0.6",
"version": "0.0.7",
"description": "Distributed transparent proxy with traffic control facilities",
"author": "Pooyan Khanjankhani <[email protected]>",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class TcpProxy implements Proxy {
retryConnection();
} else {
this.logger.error("Local socket error:", err);
clientSocket.destroy();
clientSocket.end();
}
});

Expand All @@ -113,7 +113,7 @@ class TcpProxy implements Proxy {

forwardSocket.on("error", (err) => {
this.logger.error(`Forward socket error: ${err}`);
clientSocket.destroy();
clientSocket.end();
});
}

Expand Down

0 comments on commit 6077bd8

Please sign in to comment.