Files
pyGoEdge-UserPanel/.venv/Lib/site-packages/urllib3/__pycache__/poolmanager.cpython-312.pyc

256 lines
24 KiB
Plaintext
Raw Normal View History

2025-11-18 03:36:49 +08:00
<EFBFBD>
f<> i:]<00><01><00>ddlmZddlZddlZddlZddlZddlmZddlm Z ddl
m Z m Z ddl mZddlmZdd lmZmZmZdd
lmZmZmZmZdd lmZdd lmZdd lmZddl m!Z!ddl"m#Z#ddl$m%Z%m&Z&ejNr
ddl(Z(ddl)m*Z*gd<12>Z+ejXe-<2D>Z.dZ/dZ0Gd<15>dejb<00>Z2 dd<17>Z3ejhe3e2<65>ejhe3e2<65>d<18>Z5eed<18>Z6Gd<19>de<0E>Z7Gd<1B>de7<65>Z8dd<1D>Z9y) <20>)<01> annotationsN)<01> TracebackType)<01>urljoin<69>)<02>HTTPHeaderDict<63>RecentlyUsedContainer)<01>RequestMethods)<01> ProxyConfig)<03>HTTPConnectionPool<6F>HTTPSConnectionPool<6F>port_by_scheme)<04>LocationValueError<6F> MaxRetryError<6F>ProxySchemeUnknown<77>URLSchemeUnknown)<01>BaseHTTPResponse)<01>_TYPE_SOCKET_OPTIONS)<01>connection_requires_http_tunnel)<01>Retry)<01>Timeout)<02>Url<72> parse_url)<01>Self)<03> PoolManager<65> ProxyManager<65>proxy_from_url) <0C>key_file<6C> cert_file<6C> cert_reqs<71>ca_certs<74> ca_cert_data<74> ssl_version<6F>ssl_minimum_version<6F>ssl_maximum_version<6F> ca_cert_dir<69> ssl_context<78> key_password<72>server_hostnamei@c<01>4<00>eZdZUdZded<ded<ded<ded<d ed
<d ed <d ed<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<d ed!<d"ed#<d ed$<d%ed&<d'ed(<d ed)<d*ed+<ded,<ded-<ded.<y/)0<>PoolKeyz<79>
All known keyword arguments that could be provided to the pool manager, its
pools, or the underlying connections.
All custom key schemes should include the fields in this key at a minimum.
<20>str<74>
key_scheme<EFBFBD>key_host<73>
int | None<6E>key_portzTimeout | float | int | None<6E> key_timeoutzRetry | bool | int | None<6E> key_retriesz bool | None<6E> key_blockztuple[str, int] | None<6E>key_source_address<73>
str | None<6E> key_key_file<6C>key_key_password<72> key_cert_file<6C> key_cert_reqs<71> key_ca_certszstr | bytes | None<6E>key_ca_cert_datazint | str | None<6E>key_ssl_versionzssl.TLSVersion | None<6E>key_ssl_minimum_version<6F>key_ssl_maximum_version<6F>key_ca_cert_dir<69>ssl.SSLContext | None<6E>key_ssl_context<78> key_maxsizez!frozenset[tuple[str, str]] | None<6E> key_headers<72>
Url | None<6E>
key__proxy<EFBFBD>key__proxy_headers<72>ProxyConfig | None<6E>key__proxy_configz_TYPE_SOCKET_OPTIONS | None<6E>key_socket_options<6E>key__socks_optionszbool | str | None<6E>key_assert_hostname<6D>key_assert_fingerprint<6E>key_server_hostname<6D> key_blocksizeN)<05>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__<5F>__annotations__<5F><00><00>BE:\Project\pygoedge\.venv\Lib\site-packages\urllib3/poolmanager.pyr*r*8s<><00><00><08><14>O<EFBFBD><11>M<EFBFBD><18><18>-<2D>-<2D>*<2A>*<2A><1A><1A>.<2E>.<2E><1C><1C> <20> <20><1D><1D><1D><1D><1C><1C>(<28>(<28>%<25>%<25>2<>2<>2<>2<><1F><1F>*<2A>*<2A><1B><1B>2<>2<><1A><1A>9<>9<>)<29>)<29>3<>3<>9<>9<>*<2A>*<2A>&<26>&<26>#<23>#<23><1D>rTr*c<01><00>|j<00>}|dj<00>|d<|dj<00>|d<dD],}||vs<01>||<00><01>t||j<00><00>||<<00>.|j d<05>}|<04>t |<04>|d<t |j<00><00>D]}|j|<03>|d|z<<00>|jD] }||vs<01>d||<<00>|j d<07><00> t|d<|di|<02><01>S) a<>
Create a pool key out of a request context dictionary.
According to RFC 3986, both the scheme and host are case-insensitive.
Therefore, this function normalizes both before constructing the pool
key for an HTTPS request. If you wish to change this behaviour, provide
alternate callables to ``key_fn_by_scheme``.
:param key_class:
The class to use when constructing the key. This should be a namedtuple
with the ``scheme`` and ``host`` keys at a minimum.
:type key_class: namedtuple
:param request_context:
A dictionary-like object that contain the context for a request.
:type request_context: dict
:return: A namedtuple that can be used as a connection pool key.
:rtype: PoolKey
<20>scheme<6D>host)<03>headers<72>_proxy_headers<72>_socks_optionsN<73>socket_options<6E>key_rMrS) <0B>copy<70>lower<65> frozenset<65>items<6D>get<65>tuple<6C>list<73>keys<79>pop<6F>_fields<64>_DEFAULT_BLOCKSIZE)<06> key_class<73>request_context<78>context<78>key<65> socket_opts<74>fields rU<00>_default_key_normalizerro_s<00><00>.<1E>"<22>"<22>$<24>G<EFBFBD><1F><08>)<29>/<2F>/<2F>1<>G<EFBFBD>H<EFBFBD><15><1D>f<EFBFBD>o<EFBFBD>+<2B>+<2B>-<2D>G<EFBFBD>F<EFBFBD>O<EFBFBD>?<3F><03> <0E>'<27>><3E>g<EFBFBD>c<EFBFBD>l<EFBFBD>6<>$<24>W<EFBFBD>S<EFBFBD>\<5C>%7<>%7<>%9<>:<3A>G<EFBFBD>C<EFBFBD>L<EFBFBD>?<3F> <1A>+<2B>+<2B>.<2E>/<2F>K<EFBFBD><12><1E>$)<29>+<2B>$6<><07> <20>!<21><14>G<EFBFBD>L<EFBFBD>L<EFBFBD>N<EFBFBD>#<23><03> '<27> <0B> <0B>C<EFBFBD> 0<><07><06><13> <0C><1D>$<24><1B>"<22>"<22><05> <10><07> <1F>!<21>G<EFBFBD>E<EFBFBD>N<EFBFBD>#<23>
<0F>{<7B>{<7B>?<3F>#<23>+<2B>#5<><07><0F> <20> <14> <1F>w<EFBFBD> <1F>rT<00><02>http<74>httpsc<01>.<00><00>eZdZUdZdZded<dZded< d d<14>fd<07> Zdd<08>Z dd <09>Z d dd
<EFBFBD>Z
dd <0B>Z d dd <0C>Z dd <0A>Z dd<0E>Z d dd<0F>Z dd<10>Zd d<11>Z d! d"d<12>Z<12>xZS)#raV
Allows for arbitrary requests while transparently keeping track of
necessary connection pools for you.
:param num_pools:
Number of connection pools to cache before discarding the least
recently used pool.
:param headers:
Headers to include with all requests, unless other headers are given
explicitly.
:param \**connection_pool_kw:
Additional parameters are used to create fresh
:class:`urllib3.connectionpool.ConnectionPool` instances.
Example:
.. code-block:: python
import urllib3
http = urllib3.PoolManager(num_pools=2)
resp1 = http.request("GET", "https://google.com/")
resp2 = http.request("GET", "https://google.com/mail")
resp3 = http.request("GET", "https://yahoo.com/")
print(len(http.pools))
# 2
NrC<00>proxyrF<00> proxy_configc <01>><00><01>t<00>|<00>|<02>d|vrL|d}t|t<00>s7|du}tj|d<02><03>}||_|j <00>}||d<||_|t|<01>|_ t|_
tj <00>|_ y)N<>retriesF<73><01>redirect) <0C>super<65>__init__<5F>
isinstancer<00>from_int<6E>raise_on_redirectr^<00>connection_pool_kwr<00>pools<6C>pool_classes_by_scheme<6D>key_fn_by_scheme)<07>self<6C> num_poolsrYrrwr~<00> __class__s <20>rUr{zPoolManager.__init__<5F>s<><00><><00> <0E><07><18><17>!<21> <14>*<2A> *<2A>(<28><19>3<>G<EFBFBD><1D>g<EFBFBD>u<EFBFBD>-<2D>%,<2C>5<EFBFBD>$8<>!<21><1F>.<2E>.<2E><17>5<EFBFBD>A<><07>,=<3D><07>)<29>%7<>%<<3C>%<<3C>%><3E>"<22>07<30>"<22>9<EFBFBD>-<2D>"4<><04><1F> <0C>*<2A>9<EFBFBD>5<><04>
<EFBFBD>'=<3D><04>#<23> 0<> 5<> 5<> 7<><04>rTc<01><00>|S<00>NrS<00>r<>s rU<00> __enter__zPoolManager.__enter__<5F>s<00><00><13> rTc<01>$<00>|j<00>y)NF)<01>clear)r<><00>exc_type<70>exc_val<61>exc_tbs rU<00>__exit__zPoolManager.__exit__<5F>s<00><00> <0A>
<EFBFBD>
<EFBFBD> <0C>rTc<01><00>|j|}|<04>|jj<00>}|jd<02><00> t|d<dD]}|j |d<01><00>|dk(rt D]}|j |d<01><00>|||fi|<04><01>S)a<>
Create a new :class:`urllib3.connectionpool.ConnectionPool` based on host, port, scheme, and
any additional pool keyword arguments.
If ``request_context`` is provided, it is provided as keyword arguments
to the pool class used. This method is used to actually create the
connection pools handed out by :meth:`connection_from_url` and
companion methods. It is intended to be overridden for customization.
N<> blocksize)rWrX<00>portrq)r<>rr^rbrhrf<00> SSL_KEYWORDS)r<>rWrXr<>rj<00>pool_clsrl<00>kws rU<00> _new_poolzPoolManager._new_pool<6F>s<><00><00> .2<EFBFBD>-H<>-H<><16>-P<><08> <1A> "<22>"<22>5<>5<>:<3A>:<3A><<3C>O<EFBFBD> <1B> <1E> <1E>{<7B> +<2B> 3<>+=<3D>O<EFBFBD>K<EFBFBD> (<28> .<2E>C<EFBFBD> <1B> <1F> <1F><03>T<EFBFBD> *<2A>.<2E> <12>V<EFBFBD> <1B>"<22><02><1F>#<23>#<23>B<EFBFBD><04>-<2D>#<23><18><04>d<EFBFBD>6<>o<EFBFBD>6<>6rTc<01>8<00>|jj<00>y)z<>
Empty our store of pools and direct them all to close.
This will not affect in-flight connections, but they will not be
re-used after completion.
N)r<>r<>r<>s rUr<>zPoolManager.clears<00><00> <0A>
<EFBFBD>
<EFBFBD><18><18>rTc<01><><00>|s td<01><00>|j|<04>}|xsd|d<|s'tj|dj <00>d<04>}||d<||d<|j |<05>S)a<>
Get a :class:`urllib3.connectionpool.ConnectionPool` based on the host, port, and scheme.
If ``port`` isn't given, it will be derived from the ``scheme`` using
``urllib3.connectionpool.port_by_scheme``. If ``pool_kwargs`` is
provided, it is merged with the instance's ``connection_pool_kw``
variable and used to create the new connection pool, if one is
needed.
zNo host specified.rqrW<00>Pr<>rX)r<00>_merge_pool_kwargsr rbr_<00>connection_from_context)r<>rXr<>rW<00> pool_kwargsrjs rU<00>connection_from_hostz PoolManager.connection_from_host$sz<00><00>"<14>$<24>%9<>:<3A> :<3A><1E>1<>1<>+<2B>><3E><0F>$*<2A>$4<>f<EFBFBD><0F><08>!<21><13>!<21>%<25>%<25>o<EFBFBD>h<EFBFBD>&?<3F>&E<>&E<>&G<><12>L<>D<EFBFBD>"&<26><0F><06><1F>"&<26><0F><06><1F><13>+<2B>+<2B>O<EFBFBD><<3C><rTc<01> <00>d|vr+tjdt<00>|jd<01>|dj <00>}|j
j |<02>}|s t|<02><00>||<01>}|j||<01><04>S)z<>
Get a :class:`urllib3.connectionpool.ConnectionPool` based on the request context.
``request_context`` must at least contain the ``scheme`` key and its
value must be a key in ``key_fn_by_scheme`` instance variable.
<20>strictzdThe 'strict' parameter is no longer needed on Python 3+. This will raise an error in urllib3 v2.1.0.rW<00>rj) <09>warnings<67>warn<72>DeprecationWarningrfr_r<>rbr<00>connection_from_pool_key)r<>rjrW<00>pool_key_constructor<6F>pool_keys rUr<>z#PoolManager.connection_from_contextAs<><00><00> <14><EFBFBD> &<26> <14>M<EFBFBD>M<EFBFBD>><3E>"<22> <0E>
<1C> <1F> <1F><08> )<29> <20><18>*<2A>0<>0<>2<><06>#<23>4<>4<>8<>8<><16>@<40><1C>#<23>"<22>6<EFBFBD>*<2A> *<2A>'<27><0F>8<><08><13>,<2C>,<2C>X<EFBFBD><EFBFBD>,<2C>W<>WrTc<01><00>|jj5|jj|<01>}|r |cddd<01>S|d}|d}|d}|j||||<02><05>}||j|<ddd<01>|S#1swYSxYw)a
Get a :class:`urllib3.connectionpool.ConnectionPool` based on the provided pool key.
``pool_key`` should be a namedtuple that only contains immutable
objects. At a minimum it must have the ``scheme``, ``host``, and
``port`` fields.
NrWrXr<>r<>)r<><00>lockrbr<>)r<>r<>rj<00>poolrWrXr<>s rUr<>z$PoolManager.connection_from_pool_keyZs<><00><00><12>Z<EFBFBD>Z<EFBFBD>_<EFBFBD>_<EFBFBD><18>:<3A>:<3A>><3E>><3E>(<28>+<2B>D<EFBFBD><13><1B> <1D>_<EFBFBD>%<25>X<EFBFBD>.<2E>F<EFBFBD>"<22>6<EFBFBD>*<2A>D<EFBFBD>"<22>6<EFBFBD>*<2A>D<EFBFBD><17>><3E>><3E>&<26>$<24><04>o<EFBFBD>><3E>V<>D<EFBFBD>#'<27>D<EFBFBD>J<EFBFBD>J<EFBFBD>x<EFBFBD> <20><1D><14> <0B><1D><14> <0B>s<00>A=<03>3A=<03>=Bc<01>~<00>t|<01>}|j|j|j|j|<02><01>S)a<>
Similar to :func:`urllib3.connectionpool.connection_from_url`.
If ``pool_kwargs`` is not provided and a new pool needs to be
constructed, ``self.connection_pool_kw`` is used to initialize
the :class:`urllib3.connectionpool.ConnectionPool`. If ``pool_kwargs``
is provided, it is used instead. Note that if a new pool does not
need to be created for the request, the provided ``pool_kwargs`` are
not used.
)r<>rWr<>)rr<>rXr<>rW)r<><00>urlr<6C><00>us rU<00>connection_from_urlzPoolManager.connection_from_urlts:<00><00> <16>c<EFBFBD>N<EFBFBD><01><13>(<28>(<28> <0A>F<EFBFBD>F<EFBFBD><11><16><16><01><08><08>k<EFBFBD>)<29>
<EFBFBD>
rTc<01><><00>|jj<00>}|r$|j<00>D]\}}|<04> ||=<00> |||<<00>|S#t$rY<00>!wxYw)a
Merge a dictionary of override values for self.connection_pool_kw.
This does not modify self.connection_pool_kw and returns a new dict.
Any keys in the override dictionary with a value of ``None`` are
removed from the merged dictionary.
)rr^ra<00>KeyError)r<><00>override<64>base_pool_kwargsrl<00>values rUr<>zPoolManager._merge_pool_kwargs<67>sl<00><00> <20>2<>2<>7<>7<>9<><18> <13>&<26>n<EFBFBD>n<EFBFBD>.<2E>
<EFBFBD><03>U<EFBFBD><18>=<3D><1D>,<2C>S<EFBFBD>1<>-2<>$<24>S<EFBFBD>)<29>/<2F> <20><1F><> $<24><1D><1C><1D>s<00>A<02> A<05>Ac<01>t<00>|j<00>yt|j|j|j<00> S)z<>
Indicates if the proxy requires the complete destination URL in the
request. Normally this is only needed when not using an HTTP CONNECT
tunnel.
F)rtrrurW)r<><00>
parsed_urls rU<00>!_proxy_requires_url_absolute_formz-PoolManager._proxy_requires_url_absolute_form<72>s:<00><00> <10>:<3A>:<3A> <1D><18>2<> <10>J<EFBFBD>J<EFBFBD><04>)<29>)<29>:<3A>+<<3C>+<<3C>
<EFBFBD>
<EFBFBD>
rTc <01><><00>t|<02>}|j<00>tjdtd<03><04>|j |j |j|j<00><05>}d|d<d|d<d |vr|j|d <|j|<05>r|j||fi|<04><01>}n|j||jfi|<04><01>}|xr|j<00>}|s|St||<08>}|jd
k(r&d }d|d <t|d <00>j!<00>|d <|j#d |j$<00>} t'| t(<00>st)j*| |<03><0E>} | j,rb|j/|<08>sQ|d j1<00>}
|d D]1} | j3<00>| j,vs<01> |
j5| d<01><00>3|
|d < | j7||||<06><0F>} | |d <||d<t>jAd||<08>|j=<00>|j||fi|<04><01>S#t8$r"| j:r|j=<00><00>|cYSwxYw)aN
Same as :meth:`urllib3.HTTPConnectionPool.urlopen`
with custom cross-host redirect logic and only sends the request-uri
portion of the ``url``.
The given ``url`` parameter must be absolute, such that an appropriate
:class:`urllib3.connectionpool.ConnectionPool` can be chosen for it.
Na URLs without a scheme (ie 'https://') are deprecated and will raise an error in a future version of urllib3. To avoid this DeprecationWarning ensure all URLs start with 'https://' or 'http://'. Read more in this issue: https://github.com/urllib3/urllib3/issues/2920<32>)<02>category<72>
stacklevel)r<>rWF<>assert_same_hostryrYi/<00>GET<45>bodyrwrx)<02>response<73>_poolzRedirecting %s -> %s)!rrWr<>r<>r<>r<>rXr<>rYr<><00>urlopen<65> request_uri<72>get_redirect_locationr<00>statusr<00>_prepare_for_method_changerbrwr|rr}<00>remove_headers_on_redirect<63> is_same_hostr^r_rf<00> incrementrr~<00>
drain_conn<EFBFBD>log<6F>info) r<><00>methodr<64>ryr<>r<><00>connr<6E><00>redirect_locationrw<00> new_headers<72>headers rUr<>zPoolManager.urlopen<65>sQ<00><00> <16>c<EFBFBD>N<EFBFBD><01> <0C>8<EFBFBD>8<EFBFBD> <1B> <14>M<EFBFBD>M<EFBFBD>A<01>,<2C><1C>  <0E><14>(<28>(<28><11><16><16>a<EFBFBD>f<EFBFBD>f<EFBFBD>Q<EFBFBD>X<EFBFBD>X<EFBFBD>(<28>N<><04>!&<26><02> <1D><1E><1E><02>:<3A><0E> <14>B<EFBFBD> <1E> <20>L<EFBFBD>L<EFBFBD>B<EFBFBD>y<EFBFBD>M<EFBFBD> <0F> 1<> 1<>!<21> 4<>#<23>t<EFBFBD>|<7C>|<7C>F<EFBFBD>C<EFBFBD>6<>2<EFBFBD>6<>H<EFBFBD>#<23>t<EFBFBD>|<7C>|<7C>F<EFBFBD>A<EFBFBD>M<EFBFBD>M<EFBFBD>@<40>R<EFBFBD>@<40>H<EFBFBD>$<24>I<><18>)G<>)G<>)I<><19> <20><1B>O<EFBFBD>$<24>C<EFBFBD>):<3A>;<3B><19> <13>?<3F>?<3F>c<EFBFBD> !<21><1A>F<EFBFBD><1D>B<EFBFBD>v<EFBFBD>J<EFBFBD>*<2A>2<EFBFBD>i<EFBFBD>=<3D>9<>T<>T<>V<>B<EFBFBD>y<EFBFBD>M<EFBFBD><14>&<26>&<26><19>H<EFBFBD>$4<>$4<>5<><07><19>'<27>5<EFBFBD>)<29><1B>n<EFBFBD>n<EFBFBD>W<EFBFBD>x<EFBFBD>@<40>G<EFBFBD>
<13> -<2D> -<2D>d<EFBFBD>6G<36>6G<36> <1D>7
<EFBFBD><1D>Y<EFBFBD>-<2D>,<2C>,<2C>.<2E>K<EFBFBD><1C>Y<EFBFBD>-<2D><06><19><<3C><<3C>><3E>W<EFBFBD>%G<>%G<>G<><1F>O<EFBFBD>O<EFBFBD>F<EFBFBD>D<EFBFBD>1<>(<28>(<28>B<EFBFBD>y<EFBFBD>M<EFBFBD> <1C><1D>'<27>'<27><06><03>h<EFBFBD>d<EFBFBD>'<27>S<>G<EFBFBD> <20><02>9<EFBFBD> <0A>!<21><02>:<3A><0E> <0B><08><08>'<27><13>.?<3F>@<40><10><1B><1B><1D><1B>t<EFBFBD>|<7C>|<7C>F<EFBFBD>$5<><<3C><12><<3C><<3C><><1D> <1C><16>(<28>(<28><18>#<23>#<23>%<25><15><1B>O<EFBFBD>  <1C>s<00>H,<00>,(I<03>I)<02>
N)r<><00>intrY<00>typing.Mapping[str, str] | Noner<00>
typing.Any<6E>return<72>None)r<>r)r<>ztype[BaseException] | Noner<65>zBaseException | Noner<65>zTracebackType | Noner<65>ztyping.Literal[False]r<>)
rWr+rXr+r<>r<>rj<00>dict[str, typing.Any] | Noner<65>r )r<>r<><00>NrqN<>
rXr4r<>r.rWr4r<>r<>r<>r )rj<00>dict[str, typing.Any]r<>r )r<>r*rjr<>r<>r )r<>r+r<>r<>r<>r )r<>r<>r<>r<>)r<>rr<><00>bool<6F>T<>
r<EFBFBD>r+r<>r+ryr<>r<>r<>r<>r)rNrOrPrQrtrRrur{r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<><00> __classcell__<5F>r<>s@rUrr<00>s<><00><><00><08>B<1D>E<EFBFBD>:<3A><1C>'+<2B>L<EFBFBD>$<24>+<2B><1C>37<33>8<><16>8<>1<>8<>)<29> 8<>
<0E> 8<>B<14><15>,<2C><15>&<26><15>%<25> <15>
<1F> <15>9=<3D> $7<><13>$7<><12>$7<><12> $7<>
6<> $7<>
<1C> $7<>L<1B> <20>#<23>48<34> =<3D><18>=<3D><19>=<3D><1B> =<3D>
2<> =<3D>
<1C> =<3D>:X<01>4<>X<01> <1B>X<01>2<14><1F><14>2G<32><14> <1B><14>6EI<01>
<EFBFBD><16>
<EFBFBD>%A<>
<EFBFBD> <1B>
<EFBFBD>$ <20>4<> <20> <1E> <20>, 
<EFBFBD>7;<3B>P=<3D><19>P=<3D> #<23>P=<3D>/3<>P=<3D>BL<42>P=<3D> <19>P=rTrc<01><><00><00>eZdZdZ d d<07>fd<02> Z d d <09>fd<03> Z d
d d<04>Z d d <0A>fd<05> Z<07>xZS)ra>
Behaves just like :class:`PoolManager`, but sends all requests through
the defined proxy, using the CONNECT method for HTTPS URLs.
:param proxy_url:
The URL of the proxy to be used.
:param proxy_headers:
A dictionary containing headers that will be sent to the proxy. In case
of HTTP they are being sent with each request, while in the
HTTPS/CONNECT case they are sent only once. Could be used for proxy
authentication.
:param proxy_ssl_context:
The proxy SSL context is used to establish the TLS connection to the
proxy when using HTTPS proxies.
:param use_forwarding_for_https:
(Defaults to False) If set to True will forward requests to the HTTPS
proxy to be made on behalf of the client instead of creating a TLS
tunnel via the CONNECT method. **Enabling this flag means that request
and response headers and content will be visible from the HTTPS proxy**
whereas tunneling keeps request and response headers and content
private. IP address, target hostname, SNI, and port are always visible
to an HTTPS proxy even when this flag is disabled.
:param proxy_assert_hostname:
The hostname of the certificate to verify against.
:param proxy_assert_fingerprint:
The fingerprint of the certificate to verify against.
Example:
.. code-block:: python
import urllib3
proxy = urllib3.ProxyManager("https://localhost:3128/")
resp1 = proxy.request("GET", "https://google.com/")
resp2 = proxy.request("GET", "https://httpbin.org/")
print(len(proxy.pools))
# 1
resp3 = proxy.request("GET", "https://httpbin.org/")
resp4 = proxy.request("GET", "https://twitter.com/")
print(len(proxy.pools))
# 3
c  <01>(<00><01>t|t<00>r)|j<00>d|j<00>d|j<00><00>}
n|}
t |
<EFBFBD>} | jdvrt | j<00><00>| js2tj| jd<04>} | j| <0C><05>} | |_
|xsi|_ ||_ t||||<08>|_|j| d<|j| d<|j| d<t<00> |<00>@||fi| <09><01>y) Nz://<2F>:rpr<>)r<><00>_proxyrZ<00> _proxy_config)r|r rWrXr<>rrr rb<00>_replacert<00> proxy_headers<72>proxy_ssl_contextr
rurzr{)r<><00> proxy_urlr<6C>rYr<>r<><00>use_forwarding_for_https<70>proxy_assert_hostname<6D>proxy_assert_fingerprintr<00> str_proxy_urlrtr<>r<>s <20>rUr{zProxyManager.__init__3s <00><><00> <16>i<EFBFBD>!3<> 4<>(<28>/<2F>/<2F>0<><03>I<EFBFBD>N<EFBFBD>N<EFBFBD>3C<33>1<EFBFBD>Y<EFBFBD>^<5E>^<5E>DT<44>U<>M<EFBFBD>%<25>M<EFBFBD><19>-<2D>(<28><05> <10><<3C><<3C>0<> 0<>$<24>U<EFBFBD>\<5C>\<5C>2<> 2<><14>z<EFBFBD>z<EFBFBD>!<21>%<25>%<25>e<EFBFBD>l<EFBFBD>l<EFBFBD>B<EFBFBD>7<>D<EFBFBD><19>N<EFBFBD>N<EFBFBD><04>N<EFBFBD>-<2D>E<EFBFBD><1A><04>
<EFBFBD>*<2A>0<>b<EFBFBD><04><1A>!2<><04><1E>'<27> <1D> $<24> !<21> $<24> 
<EFBFBD><04><19>(,<2C>z<EFBFBD>z<EFBFBD><1A>8<EFBFBD>$<24>/3<>/A<>/A<><1A>+<2B>,<2C>.2<EFBFBD>.?<3F>.?<3F><1A>?<3F>+<2B> <0A><07><18><19>G<EFBFBD>B<>/A<>BrTc<01><><00><01>|dk(rt<00>|<00>||||<04><02>St<00>|<00>|jj|jj|jj
|<04><02>S)Nrr)r<>)rzr<>rtrXr<>rW)r<>rXr<>rWr<>r<>s <20>rUr<>z!ProxyManager.connection_from_host\si<00><><00> <12>W<EFBFBD> <1C><18>7<EFBFBD>/<2F><14>d<EFBFBD>F<EFBFBD> <0B>0<><0E> <0E><15>w<EFBFBD>+<2B> <10>J<EFBFBD>J<EFBFBD>O<EFBFBD>O<EFBFBD>T<EFBFBD>Z<EFBFBD>Z<EFBFBD>_<EFBFBD>_<EFBFBD>d<EFBFBD>j<EFBFBD>j<EFBFBD>.?<3F>.?<3F>[<5B>,<2C>
<EFBFBD>
rTc<01>l<00>ddi}t|<01>j}|r||d<|r|j|<02>|S)z<>
Sets headers needed by proxies: specifically, the Accept and Host
headers. Only sets headers not provided by the user.
<20>Acceptz*/*<2A>Host)r<00>netloc<6F>update)r<>r<>rY<00>headers_r<5F>s rU<00>_set_proxy_headerszProxyManager._set_proxy_headersls><00><00><1D>e<EFBFBD>$<24><08><1A>3<EFBFBD><1E>&<26>&<26><06> <11>%<25>H<EFBFBD>V<EFBFBD> <1C> <12> <14>O<EFBFBD>O<EFBFBD>G<EFBFBD> $<24><17>rTc <01><><00><01>t|<02>}t|j|j|j<00>s1|j d|j <00>}|j||<06>|d<t<00>|<00>$||fd|i|<04><01>S)z@Same as HTTP(S)ConnectionPool.urlopen, ``url`` must be absolute.rYry)
rrrtrurWrbrYr<>rzr<>)r<>r<>r<>ryr<>r<>rYr<>s <20>rUr<>zProxyManager.urlopen}so<00><><00> <16>c<EFBFBD>N<EFBFBD><01>.<2E>t<EFBFBD>z<EFBFBD>z<EFBFBD>4<EFBFBD>;L<>;L<>a<EFBFBD>h<EFBFBD>h<EFBFBD>W<><19>f<EFBFBD>f<EFBFBD>Y<EFBFBD><04> <0C> <0C>5<>G<EFBFBD> <20>3<>3<>C<EFBFBD><17>A<>B<EFBFBD>y<EFBFBD>M<EFBFBD><14>w<EFBFBD><EFBFBD>v<EFBFBD>s<EFBFBD>D<>X<EFBFBD>D<><12>D<>DrT)r<>NNNFNN)r<>r+r<>r<>rYr<>r<>r<>r<>r?r<>r<>r<>z"None | str | typing.Literal[False]r<>r4rr<>r<>r<>r<>r<>r<>)r<>r+rYr<>r<>ztyping.Mapping[str, str]r<>r<>) rNrOrPrQr{r<>r<>r<>r<>r<>s@rUrr<00>s6<00><><00>4<08>r<1C>37<33>9=<3D>37<33>).<2E>DH<44>/3<>'C<01><16>'C<01><17>'C<01>1<> 'C<01>
7<> 'C<01> 1<> 'C<01>#'<27>'C<01> B<01>'C<01>#-<2D>'C<01>)<29>'C<01>
<0E>'C<01>X <20>#<23>48<34> 
<EFBFBD><18>
<EFBFBD><19>
<EFBFBD><1B> 
<EFBFBD>
2<> 
<EFBFBD>
<1C> 
<EFBFBD>"DH<01><18><16><18>!@<40><18> !<21><18>$7;<3B> E<01><19> E<01> #<23> E<01>/3<> E<01>BL<42> E<01> <19> E<01> ErTrc <01><00>tdd|i|<01><01>S)Nr<4E>rS)r)r<>r<>s rUrr<00>s<00><00> <17> ,<2C>#<23> ,<2C><12> ,<2C>,rT)riz type[PoolKey]rjr<>r<>r*)r<>r+r<>r<>r<>r):<3A>
__future__r<00> functools<6C>logging<6E>typingr<67><00>typesr<00> urllib.parser<00> _collectionsrr<00>_request_methodsr <00>
connectionr
<00>connectionpoolr r r <00>
exceptionsrrrrr<>r<00>util.connectionr<00>
util.proxyr<00>
util.retryr<00> util.timeoutr<00>util.urlrr<00> TYPE_CHECKING<4E>ssl<73>typing_extensionsr<00>__all__<5F> getLoggerrNr<>r<>rh<00>
NamedTupler*ro<00>partialr<6C>r<>rrrrSrTrU<00><module>r s<00><01>"<22><10><0E> <0A><0F><1F> <20>?<3F>,<2C>#<23>S<>S<><02><02> '<27>1<>7<><1D>!<21>$<24> <09><17><17><0E>&<26>
;<3B><07><18>g<EFBFBD><17><17><08>!<21><03> <02> <0C> <1B><12>$<1E>f<EFBFBD><1F><1F>$<1E>N4 <20><1C>4 <20>/D<>4 <20> <0C>4 <20>x <1E>I<EFBFBD> <1D> <1D>5<>w<EFBFBD> ?<3F> <1E>Y<EFBFBD> <1E> <1E>6<><07> @<40><02><10>
#5<>?R<>S<><16>W=<3D>.<2E>W=<3D>t
ME<01>;<3B>ME<01>`-rT