Implementing --proxy-freq (Issue #4496)

This commit is contained in:
Miroslav Stampar
2020-12-26 23:04:48 +01:00
parent bb02eefb70
commit 1b2ac3069d
5 changed files with 18 additions and 1 deletions

View File

@@ -285,6 +285,15 @@ class Connect(object):
kb.requestCounter += 1
threadData.lastRequestUID = kb.requestCounter
if conf.proxyFreq:
if kb.requestCounter % conf.proxyFreq == 1:
conf.proxy = None
warnMsg = "changing proxy"
logger.warn(warnMsg)
setHTTPHandlers()
if conf.dummy or conf.murphyRate and randomInt() % conf.murphyRate == 0:
if conf.murphyRate:
time.sleep(randomInt() % (MAX_MURPHY_SLEEP_TIME + 1))