Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 23f2c5f

Browse files
committed
Finishing implementation for an Issue #58
1 parent c586559 commit 23f2c5f

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

lib/core/common.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,9 +2246,6 @@ def logHTTPTraffic(requestLogMsg, responseLogMsg):
22462246
def getPageTemplate(payload, place): # Cross-linked function
22472247
raise NotImplementedError
22482248

2249-
def setHTTPProxy(): # Cross-linked function
2250-
raise NotImplementedError
2251-
22522249
def getPublicTypeMembers(type_, onlyValues=False):
22532250
"""
22542251
Useful for getting members from types (e.g. in enums)

lib/core/option.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import lib.core.common
2323
import lib.core.threads
2424
import lib.core.convert
25+
import lib.request.connect
2526

2627
from lib.controller.checks import checkConnection
2728
from lib.core.common import Backend
@@ -985,6 +986,9 @@ def _setHTTPProxy():
985986
if conf.proxyList:
986987
conf.proxy = conf.proxyList[0]
987988
conf.proxyList = conf.proxyList[1:] + conf.proxyList[:1]
989+
990+
infoMsg = "loading proxy '%s' from a supplied proxy list file" % conf.proxy
991+
logger.info(infoMsg)
988992
else:
989993
if conf.hostname in ('localhost', '127.0.0.1') or conf.ignoreProxy:
990994
proxyHandler.proxies = {}
@@ -2172,8 +2176,8 @@ def _basicOptionValidation():
21722176
def _resolveCrossReferences():
21732177
lib.core.threads.readInput = readInput
21742178
lib.core.common.getPageTemplate = getPageTemplate
2175-
lib.core.common.setHTTPProxy = _setHTTPProxy
21762179
lib.core.convert.singleTimeWarnMessage = singleTimeWarnMessage
2180+
lib.request.connect.setHTTPProxy = _setHTTPProxy
21772181

21782182
def initOptions(inputOptions=AttribDict(), overrideOptions=False):
21792183
if not inputOptions.disableColoring:

lib/request/connect.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
from lib.core.common import randomStr
3838
from lib.core.common import readInput
3939
from lib.core.common import removeReflectiveValues
40-
from lib.core.common import setHTTPProxy
4140
from lib.core.common import singleTimeLogMessage
4241
from lib.core.common import singleTimeWarnMessage
4342
from lib.core.common import stdev
@@ -112,8 +111,7 @@ def _retryProxy(**kwargs):
112111
warnMsg = "changing proxy"
113112
logger.warn(warnMsg)
114113

115-
conf.proxy = conf.proxyList[0]
116-
conf.proxyList = conf.proxyList[1:] + conf.proxyList[:1]
114+
conf.proxy = None
117115
setHTTPProxy()
118116

119117
if kb.testMode and kb.previousMethod == PAYLOAD.METHOD.TIME:
@@ -900,3 +898,6 @@ def _randomizeParameter(paramString, randomParameter):
900898
return comparison(page, headers, code, getRatioValue=False, pageLength=pageLength), comparison(page, headers, code, getRatioValue=True, pageLength=pageLength)
901899
else:
902900
return comparison(page, headers, code, getRatioValue, pageLength)
901+
902+
def setHTTPProxy(): # Cross-linked function
903+
raise NotImplementedError

0 commit comments

Comments
 (0)