MCPcopy
hub / github.com/urllib3/urllib3 / connect

Method connect

src/urllib3/connection.py:330–345  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

328 response.close()
329
330 def connect(self) -> None:
331 self.sock = self._new_conn()
332 if self._tunnel_host:
333 # If we're tunneling it means we're connected to our proxy.
334 self._has_connected_to_proxy = True
335
336 # TODO: Fix tunnel so it doesn't depend on self.sock state.
337 self._tunnel()
338
339 # If there's a proxy to be connected to we are fully connected.
340 # This is set twice (once above and here) due to forwarding proxies
341 # not using tunnelling.
342 self._has_connected_to_proxy = bool(self.proxy)
343
344 if self._has_connected_to_proxy:
345 self.proxy_is_verified = False
346
347 @property
348 def is_closed(self) -> bool:

Callers 2

_prepare_proxyMethod · 0.45
_validate_connMethod · 0.45

Calls 2

_new_connMethod · 0.95
_tunnelMethod · 0.95

Tested by

no test coverage detected