MCPcopy
hub / github.com/encode/httpx / _transport_for_url

Method _transport_for_url

httpx/_client.py:760–769  ·  httpx/_client.py::Client._transport_for_url

Returns the transport instance that should be used for a given URL. This will either be the standard connection pool, or a proxy.

(self, url: URL)

Source from the content-addressed store, hash-verified

758 )
759
760 def _transport_for_url(self, url: URL) -> BaseTransport:
761 class="st">"""
762 Returns the transport instance that should be used for a given URL.
763 This will either be the standard connection pool, or a proxy.
764 class="st">"""
765 for pattern, transport in self._mounts.items():
766 if pattern.matches(url):
767 return self._transport if transport is None else transport
768
769 return self._transport
770
771 def request(
772 self,

Callers 5

_send_single_requestMethod · 0.95
test_socks_proxyFunction · 0.95
test_proxy_with_mountsFunction · 0.95
test_proxies_environFunction · 0.45

Calls 2

matchesMethod · 0.80
itemsMethod · 0.45

Tested by 4

test_socks_proxyFunction · 0.76
test_proxy_with_mountsFunction · 0.76
test_proxies_environFunction · 0.36