mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-04-24 07:01:25 +00:00
bugfix: process.on("exit",function(code){
This commit is contained in:
parent
0e387382c8
commit
bcb1f9d895
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "anyproxy",
|
||||
"version": "2.8.3",
|
||||
"version": "2.8.4",
|
||||
"description": "A fully configurable proxy in NodeJS, which can handle HTTPS requests perfectly.",
|
||||
"main": "proxy.js",
|
||||
"bin": {
|
||||
|
8
proxy.js
8
proxy.js
@ -150,8 +150,14 @@ function proxyServer(option){
|
||||
|
||||
//TODO : uncaught exception
|
||||
//kill web server when father process exits
|
||||
process.on("exit uncaughtException",function(){
|
||||
process.on("exit",function(code){
|
||||
child_webServer.kill();
|
||||
console.log('AnyProxy is about to exit with code:', code);
|
||||
process.exit();
|
||||
});
|
||||
process.on("uncaughtException",function(err){
|
||||
child_webServer.kill();
|
||||
console.log('Caught exception: ' + err);
|
||||
process.exit();
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user