Browse Source

fix proxy usage with SOCKS (#40)

Signed-off-by: R4SAS <r4sas@i2pmail.org>
pull/45/head
R4SAS 2 years ago
parent
commit
08dbceebc6
Signed by: r4sas
GPG Key ID: 66F6C87B98EBCFE2
  1. 9
      pbincli/api.py

9
pbincli/api.py

@ -4,7 +4,14 @@ from pbincli.utils import PBinCLIError
def _config_requests(settings=None): def _config_requests(settings=None):
if settings['proxy']: 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: else:
proxy = {} proxy = {}

Loading…
Cancel
Save