mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-08-14 06:11:25 +00:00
addr_map_ only accepted IP literals as mapped values; a non-IP value was passed as the `ip` argument and rejected by getaddrinfo's AI_NUMERICHOST path. The lookup in ClientImpl::create_client_socket and WebSocketClient::connect now checks the mapped value with detail::is_ip_address: IP literals keep the existing AI_NUMERICHOST path, while hostnames are passed as the connect host so they get resolved. host_ is never touched, so it keeps supplying the Host header and SNI in both cases. is_ip_address() moved into the non-SSL detail block so that both client code paths can use it without CPPHTTPLIB_SSL_ENABLED. This also fixes the documented Unix domain socket client example, where the mapped value is a socket path: it previously took the AI_NUMERICHOST path and never reached the AF_UNIX branch in create_socket.