mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-05-10 06:48:26 +00:00
bugfix for https throttle
This commit is contained in:
parent
c5ffd57e71
commit
d5b6958dd9
@ -295,14 +295,22 @@ function connectReqHandler(req, socket, head){
|
||||
callback();
|
||||
}
|
||||
|
||||
|
||||
//connect
|
||||
},function(callback){
|
||||
try{
|
||||
var conn = net.connect(proxyPort, proxyHost, function(){
|
||||
socket.write('HTTP/' + req.httpVersion + ' 200 OK\r\n\r\n', 'UTF-8', function() {
|
||||
socket.write('HTTP/' + req.httpVersion + ' 200 OK\r\n\r\n', 'UTF-8', function(){
|
||||
|
||||
//throttle for direct-foward https
|
||||
if(GLOBAL._throttle && !shouldIntercept ){
|
||||
var readable = conn.pipe(GLOBAL._throttle.throttle());
|
||||
readable.pipe(socket);
|
||||
|
||||
socket.pipe(conn);
|
||||
}else{
|
||||
conn.pipe(socket);
|
||||
socket.pipe(conn);
|
||||
}
|
||||
|
||||
callback();
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "anyproxy",
|
||||
"version": "3.0.2",
|
||||
"version": "3.0.3",
|
||||
"description": "A fully configurable proxy in NodeJS, which can handle HTTPS requests perfectly.",
|
||||
"main": "proxy.js",
|
||||
"bin": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user