recover tips for web server

This commit is contained in:
加里 2014-09-22 13:59:23 +08:00
parent 172b6ac455
commit e2ee6c996a
4 changed files with 10 additions and 4 deletions

View File

@ -2,7 +2,7 @@ var isRootCAFileExists = require("./certMgr.js").isRootCAFileExists();
module.exports = { module.exports = {
summary:function(){ summary:function(){
var tip = "the default rule for anyproxy, support : CORS"; var tip = "the default rule for anyproxy, support : CORS. ";
if(isRootCAFileExists){ if(isRootCAFileExists){
tip += "\nRoot CA exists, will intercept all https requests for you"; tip += "\nRoot CA exists, will intercept all https requests for you";
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "anyproxy", "name": "anyproxy",
"version": "2.4.3", "version": "2.4.4",
"description": "A fully configurable proxy in NodeJS, which can handle HTTPS requests perfectly.", "description": "A fully configurable proxy in NodeJS, which can handle HTTPS requests perfectly.",
"main": "proxy.js", "main": "proxy.js",
"bin": { "bin": {

View File

@ -119,6 +119,11 @@ function proxyServer(option){
} }
}); });
//kill web server when father process exits
process.on("exit",function(){
child_webServer.kill();
});
GLOBAL.recorder.on("update",function(data){ GLOBAL.recorder.on("update",function(data){
child_webServer.send({ child_webServer.send({
type: "update", type: "update",
@ -131,6 +136,9 @@ function proxyServer(option){
console.log(arguments); console.log(arguments);
}) })
var tipText = "web interface started at port " + proxyWebPort;
console.log(color.green(tipText));
callback(null); callback(null);
} }
], ],

View File

@ -63,8 +63,6 @@ function proxyWebServer(port,webSocketPort,proxyConfigPort,ruleSummary,recorder)
app.listen(port); app.listen(port);
var tipText = "web interface started at port " + port;
//web socket interface //web socket interface
var wss = new WebSocketServer({port: webSocketPort}); var wss = new WebSocketServer({port: webSocketPort});
wss.on("connection",function(ws){}); wss.on("connection",function(ws){});