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

Function is_ipv4_hostname

httpx/_utils.py:229–234  ·  view source on GitHub ↗
(hostname: str)

Source from the content-addressed store, hash-verified

227
228
229def is_ipv4_hostname(hostname: str) -> bool:
230 try:
231 ipaddress.IPv4Address(hostname.split("/")[0])
232 except Exception:
233 return False
234 return True
235
236
237def is_ipv6_hostname(hostname: str) -> bool:

Callers 1

get_environment_proxiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected