Skip to content

Commit 9a9b176

Browse files
samschottblurb-it[bot]arhadthedev
authored
gh-104180: Read SOCKS proxies from macOS System Configuration (#104181)
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 <[email protected]>
1 parent bf89d42 commit 9a9b176

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Support reading SOCKS proxy configuration from macOS System Configuration.
2+
Patch by Sam Schott.

Modules/_scproxy.c

+5
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@ get_proxies(PyObject* Py_UNUSED(mod), PyObject *Py_UNUSED(ignored))
206206
kSCPropNetProxiesGopherProxy,
207207
kSCPropNetProxiesGopherPort);
208208
if (r == -1) goto error;
209+
r = set_proxy(result, "socks", proxyDict,
210+
kSCPropNetProxiesSOCKSEnable,
211+
kSCPropNetProxiesSOCKSProxy,
212+
kSCPropNetProxiesSOCKSPort);
213+
if (r == -1) goto error;
209214

210215
CFRelease(proxyDict);
211216
return result;

0 commit comments

Comments
 (0)