mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-08-04 21:39:04 +00:00
reconstruct map local
This commit is contained in:
@@ -14,8 +14,13 @@ var express = require("express"),
|
||||
function webInterface(config){
|
||||
var port = config.port,
|
||||
wsPort = config.wsPort,
|
||||
ruleSummary = config.ruleSummary,
|
||||
ipAddress = config.ip;
|
||||
ipAddress = config.ip,
|
||||
userRule = config.userRule,
|
||||
ruleSummary = "";
|
||||
|
||||
try{
|
||||
ruleSummary = userRule.summary();
|
||||
}catch(e){}
|
||||
|
||||
var self = this,
|
||||
myAbsAddress = "http://" + ipAddress + ":" + port +"/",
|
||||
@@ -80,8 +85,6 @@ function webInterface(config){
|
||||
res.setHeader("Content-Type", "text/html");
|
||||
res.end(resDom);
|
||||
});
|
||||
|
||||
|
||||
|
||||
app.use(function(req,res,next){
|
||||
var indexTpl = fs.readFileSync(path.join(staticDir,"/index.html"),{encoding:"utf8"}),
|
||||
@@ -100,7 +103,14 @@ function webInterface(config){
|
||||
});
|
||||
|
||||
app.use(express.static(staticDir));
|
||||
app.listen(port);
|
||||
|
||||
if(typeof userRule._plugIntoWebinterface == "function"){
|
||||
userRule._plugIntoWebinterface(app,function(){
|
||||
app.listen(port);
|
||||
});
|
||||
}else{
|
||||
app.listen(port);
|
||||
}
|
||||
|
||||
self.app = app;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user