1
1
mirror of https://github.com/r4sas/PBinCLI synced 2025-02-03 10:25:11 +00:00

fix proxy usage with SOCKS (#40)

Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
R4SAS 2023-04-06 22:48:11 +03:00
parent a3386131a7
commit 08dbceebc6
Signed by: r4sas
GPG Key ID: 66F6C87B98EBCFE2

View File

@ -4,7 +4,14 @@ from pbincli.utils import PBinCLIError
def _config_requests(settings=None):
if settings['proxy']:
proxy = {settings['proxy'].split('://')[0]: settings['proxy']}
scheme = settings['proxy'].split('://')[0]
if (scheme.startswith("socks")):
proxy = {
"http": settings['proxy'],
"https": settings['proxy']
}
else:
proxy = {scheme: settings['proxy']}
else:
proxy = {}