Add .attachDebuggger() method #51 #43 (2nd commit)

This commit is contained in:
Namhyeon Go 2022-05-30 18:25:41 +09:00
parent 0eb1552687
commit a43bc8f03b

View File

@ -741,18 +741,37 @@ var HTTPObject = function(engine) {
this.attachDebugger = function(_debugger) {
var _debugger = _debugger.toUpperCase();
console.warn("Existing proxy settings will be reset.");
switch(_debugger) {
case "FIDDLER":
this.proxy.enabled = true;
this.proxy.port = 8866;
this.proxy = {
"enabled": true,
"protocol": "http",
"host": "127.0.0.1",
"port": 8866,
"credential": null
};
break;
case "MITMPROXY":
this.proxy.enabled = true;
this.proxy.port = 8080;
this.proxy = {
"enabled": true,
"protocol": "http",
"host": "127.0.0.1",
"port": 8080,
"credential": null
};
break;
default:
this.proxy = {
"enabled": false,
"protocol": "http",
"host": "127.0.0.1",
"port": 80,
"credential": null
};
console.error("Not specified debugger");
}