Surprisingly, on my Linux system, when connected to a localhost service using IPV4, stream_get_socket_name returns ::1 as the peer or local address. One would expect to get localhost or 127.0.0.1 but the ::1 IPV6 localhost is returned instead.
(PHP 5, PHP 7, PHP 8)
stream_socket_get_name — Recuperar el nombre de los sockets locales o remotos
Devuelve el nombre local o remoto de una conexión de socket dada.
handle
El socket del que se va a obtener el nombre.
want_peer
Si se establece a true
se devolverá el nombre del socket remoto
, si
se establece a false
se devolverá el nombre del socket local
.
El nombre del socket.
Surprisingly, on my Linux system, when connected to a localhost service using IPV4, stream_get_socket_name returns ::1 as the peer or local address. One would expect to get localhost or 127.0.0.1 but the ::1 IPV6 localhost is returned instead.