Is it possible to get the IP address of client machine from sockaddr.
From client I mean a system or browser using which a user is connected to a server.
I assume that client is behind some proxy/routers and is not directly connected to the server.
You can get the IP address that the server sends it response packets to. Often this is the IP address of the client computer, but it doesn’t have to be:
If you need the IP address of the client computer, the client will have to send that as data to the server. Please note that there is no guarantee that the address you receive this way is the real one. Even if it is the real one, it cannot be guaranteed to be unique (many corporate networks use addresses in the 192.168.X.X series reserved for internal use). There is also no very likely that you won’t be able to connect to the client on it’s internal address.