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) { this.attachDebugger = function(_debugger) {
var _debugger = _debugger.toUpperCase(); var _debugger = _debugger.toUpperCase();
console.warn("Existing proxy settings will be reset.");
switch(_debugger) { switch(_debugger) {
case "FIDDLER": case "FIDDLER":
this.proxy.enabled = true; this.proxy = {
this.proxy.port = 8866; "enabled": true,
"protocol": "http",
"host": "127.0.0.1",
"port": 8866,
"credential": null
};
break; break;
case "MITMPROXY": case "MITMPROXY":
this.proxy.enabled = true; this.proxy = {
this.proxy.port = 8080; "enabled": true,
"protocol": "http",
"host": "127.0.0.1",
"port": 8080,
"credential": null
};
break; break;
default: default:
this.proxy = {
"enabled": false,
"protocol": "http",
"host": "127.0.0.1",
"port": 80,
"credential": null
};
console.error("Not specified debugger"); console.error("Not specified debugger");
} }