From 08dbceebc63ecb48f248ff1587ca3b80c6b249f7 Mon Sep 17 00:00:00 2001 From: R4SAS Date: Thu, 6 Apr 2023 22:48:11 +0300 Subject: [PATCH] fix proxy usage with SOCKS (#40) Signed-off-by: R4SAS --- pbincli/api.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pbincli/api.py b/pbincli/api.py index f526d3a..0b48194 100644 --- a/pbincli/api.py +++ b/pbincli/api.py @@ -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 = {}