No it is not possible. BTW, if you need to talk to any machine on the
internet, then by definition you must be behind a router - no
exceptions. But I think what you mean is a firewall, NAT (network
address translation) or proxy server, right?
You can do a few things to guess:
* if your ip is 192.X.X.X or 10.X.X.X then you have a private ip address
and if you need to talk to any other machine on the internet, you must
be behind a router/firewall/proxy that is doing NAT.
* see if your JVM is using SOCKS, or a proxy to get at web addresses. If
so you are behind a firewall.
* attempt to make connections to a known ip address on the internet.
Connect with http, https, telnet, and some other arbitrary ports. Based
on the successes and/or failures you can determine the nature of the
* if you can, obtain the routing info for your server. I am unsure as
to how to do this directly from Java, however the following command on
UNIX and Windows (I think - NT/2000/XP) will reveal routes, interfaces,
and gateways (router/firewall):
Missaka Wijekoon (a.k.a. Misk) XXXX@XXXXX.COM
Sr. Software Engineer http://www.yqcomputer.com/