Permalink
Browse files

update router

  • Loading branch information...
1 parent ef6f75c commit 87a77e89a7b11b618e9467a43500a983f5686bd1 @rehorn committed Apr 11, 2013
Showing with 20 additions and 29 deletions.
  1. +2 −2 lib/core.js
  2. +2 −2 lib/livepool/config.js
  3. +1 −1 lib/livepool/responder/route.js
  4. +15 −24 rules/project2.js
View
@@ -12,7 +12,7 @@ var responders = require('./livepool/responder');
var httpServer, httpsServer, https2http;
var livepool = module.exports = {};
-livepool.verson = '0.0.1';
+livepool.verson = '0.0.2';
livepool.startTime = (new Date()).getTime();
var config = liveRequire('config'),
@@ -56,7 +56,7 @@ livepool.run = function (){
var handler = config.getHandler(reqInfo);
var reqUrl = reqInfo.url;
// local replacement
- console.log(handler)
+ // console.log(handler)
if(handler && (responder = responders[handler.respond.type])){
logger.log('req handler [ ' + handler.respond.type.grey + ' ]: ' + reqUrl.grey);
responder(handler, req, res);
@@ -112,8 +112,8 @@ config.loadRules = function(){
});
});
});
- console.log(config.handlers);
- console.log(config.routers);
+ // console.log(config.handlers);
+ // console.log(config.routers);
};
config.updateRules = function(rules){
@@ -32,7 +32,7 @@ function routeResponder(router, req, res){
function goProxy(req, res, host, port){
var dhost = req.headers.host.split(':');
- host = host || dhost[0];
+ host = host || dhost[0] || '127.0.0.1';
port = port || dhost[1] || 80;
logger.log('req proxied, host:' + host + ', port:' + port + ', url:' + req.url);
proxy.proxyRequest(req, res, {
View
@@ -1,36 +1,27 @@
module.exports = {
name: "project2",
- index: 0,
- enabled: 1,
- base: "E:/connect/bapp/widget_trunk/web/chat/src/",
+ base: "E:/connect/bapp/qqfind_v2/",
handler: [{
- match: "chat.qq.com/index.html",
- action: "./__index.html",
- enabled: 1
+ match: "find.qq.com/index.html",
+ action: "./__index.html"
}, {
- match: "chat.qq.com/js/chat.all.js",
- action: "./tools/chat.all.qzmin",
- enabled: 1
+ match: "find.qq.com/js/find.all.js",
+ action: "./tools/find.all.js.qzmin"
}, {
- match: "chat.qq.com/css/main.css",
- action: ["./css/sub1.css", "./css/sub2.css"],
- enabled: 1
+ match: "find.qq.com/css/comp.css",
+ action: ["./css/loading.css", "./css/tab.css"]
}, {
- match: "chat.qq.com/css/remote.css",
- action: "http://chat.qq.com/css/remote2.css",
- enabled: 1
+ match: "find.qq.com/js/catalog.js",
+ action: "http://pub.idqqimg.com/qqfind/js/groupcatalog.js"
}, {
- match: "chat.qq.com/ *.url.cn/chat/",
- action: "./",
- enabled: 1
+ match: "find.qq.com/ *.idqqimg.com/qqfind/",
+ action: "./"
}],
router: [{
- match: "chat.qq.com/cgi-bin/ srv.chat.qq.com",
- action: "-",
- enabled: 1
+ match: "find.qq.com/cgi-bin/ cgi.find.qq.com",
+ action: "-"
}, {
- match: "chat.qq.com",
- action: "172.23.136.86",
- enabled: 1
+ match: "find.qq.com idqqimg.com/qqfind/",
+ action: "172.23.136.84"
}]
};

0 comments on commit 87a77e8

Please sign in to comment.