We are writing a HTTP based desktop application whose client runs from outside our NAT. We code and test from inside the NAT. The http server sits within our NAT (yes it is bad network design). What would be the best Java method for automatically detecting where the HTTP client is launching from and passing the appropriate server IP (i.e. NAT internal or External) ?
server_ip = 0.0.0.0
if(inside_nat())
server_ip = 192.168.0.*
else
server_ip = 202.13.14.15
Need a java implementation of insider_nat()