amphp / socket

Non-blocking socket and TLS functionality for PHP based on Amp.
https://amphp.org/socket
MIT License
231 stars 38 forks source link

Provide a hook between resolve() and stream_socket_client() in DnsSocketConnector #114

Open nicolas-grekas opened 2 months ago

nicolas-grekas commented 2 months ago

Follow up of https://github.com/symfony/symfony/pull/54179#discussion_r1514886587

Reading DnsSocketConnector, there is no easy way currently to hook between resolve() and stream_socket_client(). Providing a custom resolver doesn't help because of the inet_pton($host) shortcut.

Hooking here is useful for e.g. Symfony's NoPrivateNetworkHttpClient so that it can filter the remote host before trying to connect to it.