views:

259

answers:

1

I'd like to display an IPv6 address on a web page, as done on

http://ipv6.whatismyv6.com/

What's the best way to do this? A code sample would be most awesome.

+1  A: 

This should not be done with javascript, since javascript is executed clientside. Generally, you want to do this serverside. In IPV6-enabled web applications, it is usually pretty obvious how to get an ipv6 address (e.g. in C#, you can use HttpRequest.UserHostAddress and it will return the address in whatever format it receives it in).

Of course, in theory you could use javascript to download the user's ipaddress from an external website...but don't do that.

Brian