Skip to content

Commit

Permalink
gh-104180: Read SOCKS proxies from macOS System Configuration (#104181)
Browse files Browse the repository at this point in the history
read SOCKS proxies from macOS System Configuration in ``urllib.request``.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
  • Loading branch information
3 people authored May 9, 2023
1 parent bf89d42 commit 9a9b176
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Support reading SOCKS proxy configuration from macOS System Configuration.
Patch by Sam Schott.
5 changes: 5 additions & 0 deletions Modules/_scproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ get_proxies(PyObject* Py_UNUSED(mod), PyObject *Py_UNUSED(ignored))
kSCPropNetProxiesGopherProxy,
kSCPropNetProxiesGopherPort);
if (r == -1) goto error;
r = set_proxy(result, "socks", proxyDict,
kSCPropNetProxiesSOCKSEnable,
kSCPropNetProxiesSOCKSProxy,
kSCPropNetProxiesSOCKSPort);
if (r == -1) goto error;

CFRelease(proxyDict);
return result;
Expand Down

0 comments on commit 9a9b176

Please sign in to comment.