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

Skip to content

Commit 1c92d8d

Browse files
committed
More generic implementation for --proxy-file (accepting public lists format)
1 parent 36a590e commit 1c92d8d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/core/option.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
from lib.core.common import paths
4848
from lib.core.common import randomRange
4949
from lib.core.common import randomStr
50+
from lib.core.common import readCachedFileContent
5051
from lib.core.common import readInput
5152
from lib.core.common import resetCookieJar
5253
from lib.core.common import runningAsAdmin
@@ -1947,7 +1948,10 @@ def _setProxyList():
19471948
if not conf.proxyFile:
19481949
return
19491950

1950-
conf.proxyList = getFileItems(conf.proxyFile)
1951+
conf.proxyList = []
1952+
for match in re.finditer(r"(?i)((http[^:]*|socks[^:]*)://)?([\w.]+):(\d+)", readCachedFileContent(conf.proxyFile)):
1953+
_, type_, address, port = match.groups()
1954+
conf.proxyList.append("%s://%s:%s" % (type_ or "http", address, port))
19511955

19521956
def _setTorProxySettings():
19531957
if not conf.tor:

0 commit comments

Comments
 (0)