Get IP from a client calling into stream_socket_server

How to get IP form a client calling into a server
I am going to use the following commands?

stream_socket_server
stream_select
stream_socket_accept
fread

Do any of these command get the IP from the client calling into a server?
Is there I command that I need to use?

I plan on running this script on a LAMP server.

Any help would be great.

If it’s an HTTP request, you can simply read the IP from the headers.

It should be stored in one of these fields.

HTTP_CLIENT_IP
HTTP_X_FORWARDED_FOR can be comma delimited list of IPs
HTTP_X_FORWARDED
HTTP_X_CLUSTER_CLIENT_IP
HTTP_FORWARDED_FOR
HTTP_FORWARDED

Sponsor our Newsletter | Privacy Policy | Terms of Service