update to 4.0

This commit is contained in:
Otto Mao
2017-12-01 21:30:49 +08:00
parent e392fefc64
commit 4be5aa8954
267 changed files with 27008 additions and 84482 deletions

View File

@@ -1,37 +1,35 @@
var proxy = require("../proxy.js"),
proxyTester = require("proxy-eval"),
WebSocket = require("ws"),
Buffer = require("buffer").Buffer,
express = require("express");
const proxyTester = require('proxy-eval'),
Buffer = require('buffer').Buffer,
express = require('express');
var app = express()
const app = express();
app.post('/', function (req, res) {
var bigBody = new Buffer(1024 * 1024 * 10);
res.send( bigBody ); //10 mb
app.post('/', (req, res) => {
const 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);
};
function test() {
//test the basic availibility of proxy server
setTimeout(() => {
const 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, (results) => {
process.exit();
});
}, 1000);
}
setTimeout(function(){
test();
},3000);
setTimeout(() => {
test();
}, 3000);