mirror of https://github.com/python/cpython
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 <oleg@arhadthedev.net>
This commit is contained in:
parent
bf89d4283a
commit
9a9b176eb7
|
@ -0,0 +1,2 @@
|
||||||
|
Support reading SOCKS proxy configuration from macOS System Configuration.
|
||||||
|
Patch by Sam Schott.
|
|
@ -206,6 +206,11 @@ get_proxies(PyObject* Py_UNUSED(mod), PyObject *Py_UNUSED(ignored))
|
||||||
kSCPropNetProxiesGopherProxy,
|
kSCPropNetProxiesGopherProxy,
|
||||||
kSCPropNetProxiesGopherPort);
|
kSCPropNetProxiesGopherPort);
|
||||||
if (r == -1) goto error;
|
if (r == -1) goto error;
|
||||||
|
r = set_proxy(result, "socks", proxyDict,
|
||||||
|
kSCPropNetProxiesSOCKSEnable,
|
||||||
|
kSCPropNetProxiesSOCKSProxy,
|
||||||
|
kSCPropNetProxiesSOCKSPort);
|
||||||
|
if (r == -1) goto error;
|
||||||
|
|
||||||
CFRelease(proxyDict);
|
CFRelease(proxyDict);
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue