November 12th, 2012, 07:17 AM
Inet_client_addr() and strange result
I use inet_client_addr() funkction to get IP address that current session comes from, but the result surprises me.
I'm connecting from machine 192.168.1.100 to postgres server 192.168.1.200.
inet_client_addr() function gives me back 192.168.1.1 (addrres of my router) instead of 192.168.1.100.
Do I do something wrong? Maybe this is some kind of bug? How to get result that I need - mean address IP of current session?
November 12th, 2012, 07:27 AM
I found answer. I have port forwarding and for my convenience I've connected to the server from outside (with outside address).