From 81f144262cf369435f6065f2ef660f017aa36ae0 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Mon, 30 May 2022 18:25:04 +0900 Subject: [PATCH] Update http.js --- lib/http.js | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/lib/http.js b/lib/http.js index f009342..12ca315 100644 --- a/lib/http.js +++ b/lib/http.js @@ -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"); }