mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-06-07 09:48:21 +00:00
fix https issue
This commit is contained in:
parent
179090382f
commit
45433d6e0c
@ -16,6 +16,7 @@ var httpsServerMgrInstance = new httpsServerMgr(),
|
|||||||
userRule = defaultRule; //init
|
userRule = defaultRule; //init
|
||||||
|
|
||||||
function userRequestHandler(req,userRes){
|
function userRequestHandler(req,userRes){
|
||||||
|
|
||||||
var host = req.headers.host,
|
var host = req.headers.host,
|
||||||
urlPattern = url.parse(req.url),
|
urlPattern = url.parse(req.url),
|
||||||
path = urlPattern.path,
|
path = urlPattern.path,
|
||||||
@ -220,6 +221,11 @@ function connectReqHandler(req, socket, head){
|
|||||||
|
|
||||||
var shouldIntercept = userRule.shouldInterceptHttpsReq(req);
|
var shouldIntercept = userRule.shouldInterceptHttpsReq(req);
|
||||||
|
|
||||||
|
//bypass webSocket on webinterface
|
||||||
|
if(targetPort == 8003){
|
||||||
|
shouldIntercept = false; // TODO : a more general solution?
|
||||||
|
}
|
||||||
|
|
||||||
console.log(color.green("\nreceived https CONNECT request " + host));
|
console.log(color.green("\nreceived https CONNECT request " + host));
|
||||||
if(shouldIntercept){
|
if(shouldIntercept){
|
||||||
console.log("==>will forward to local https server");
|
console.log("==>will forward to local https server");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "anyproxy",
|
"name": "anyproxy",
|
||||||
"version": "2.3.3",
|
"version": "2.3.4",
|
||||||
"description": "a charles/fiddler like proxy written in NodeJs, which can handle HTTPS requests and CROS perfectly.",
|
"description": "a charles/fiddler like proxy written in NodeJs, which can handle HTTPS requests and CROS perfectly.",
|
||||||
"main": "proxy.js",
|
"main": "proxy.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user