3 ms·
> It does strike me as weird that there is seemingly no POSIX-compliant way to get your public Internet address, from my readings. Because traditionally if you
by fulafel 5y ago
> It does strike me as weird that there is seemingly no POSIX-compliant way to get your public Internet address, from my readings.
Because traditionally if you're doing things right, you're not using NAT, which is against IP specs and a nonstandard kludge. So you just take your socket and query its local endpoint address using getsockname and voila.