Answer the question
In order to leave comments, you need to log in
Get address of client connected via NAT by socket descriptor?
There is a client, there is a server on the Internet; the client connects to the server from the local network through NAT.
More precisely, through several NATs:
192.168.3.x (this is the client) ->192.168.3.1 -> 192.168.2.1 -> 192.168.1.1 -> (ISP) -> server
Problem: the server does a getpeername(..) and gets the address client 192.168.1.1; you need its external Internet address (for geolocation).
What to do?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question