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

Method _transport_for_url

httpx/_client.py:1474–1483  ·  view source on GitHub ↗

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

1472 )
1473
1474 def _transport_for_url(self, url: URL) -> AsyncBaseTransport:
1475 """
1476 Returns the transport instance that should be used for a given URL.
1477 This will either be the standard connection pool, or a proxy.
1478 """
1479 for pattern, transport in self._mounts.items():
1480 if pattern.matches(url):
1481 return self._transport if transport is None else transport
1482
1483 return self._transport
1484
1485 async def request(
1486 self,

Callers 2

_send_single_requestMethod · 0.95
test_socks_proxyFunction · 0.95

Calls 2

matchesMethod · 0.80
itemsMethod · 0.45

Tested by 1

test_socks_proxyFunction · 0.76