move response data from memory to local cache file

This commit is contained in:
OttoMao
2015-10-24 23:37:43 +08:00
parent 31daeebdd5
commit cfc817cb1f
13 changed files with 248 additions and 60 deletions

37
test/large_post.js Normal file
View File

@@ -0,0 +1,37 @@
var proxy = require("../proxy.js"),
proxyTester = require("proxy-eval"),
WebSocket = require("ws"),
Buffer = require("buffer").Buffer,
express = require("express");
var app = express()
app.post('/', function (req, res) {
var bigBody = new Buffer(1024 * 1024 * 10);
res.send( bigBody ); //10 mb
});
app.listen(3000);
function test(){
//test the basic availibility of proxy server
setTimeout(function(){
var testParam = {
proxy : 'http://127.0.0.1:8001/',
reqTimeout : 4500,
httpGetUrl : "",
httpPostUrl : "http://127.0.0.1:3000/",
httpPostBody : "123",
httpsGetUrl : "",
httpsPostUrl : "",
httpsPostBody : ""
};
proxyTester.test(testParam ,function(results){
process.exit();
});
},1000);
};
setTimeout(function(){
test();
},3000);

View File

@@ -44,7 +44,13 @@ exports.avalibility = function(test){
//test the basic availibility of proxy server
setTimeout(function(){
proxyTester.test({proxy : 'http://127.0.0.1:8995',reqTimeout:4500} ,function(results){
var testParam = {
proxy : 'http://127.0.0.1:8995',
reqTimeout : 4500,
httpsPostUrl : "http://www.sample.com/"
httpsPostBody : "123"
};
proxyTester.test(testParam ,function(results){
var successCount = 0;
results.map(function(item){
item.success && ++successCount;