summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2011-07-09 09:24:15 +0000
committerPaul Buetow <paul@buetow.org>2011-07-09 09:24:15 +0000
commit9c3a3338cb8acad272e99b8e2934681e16497b41 (patch)
tree100a029be9a81cbf30c84f3bd1b98ef3279494be
ipv6 test website added
-rw-r--r--COPYING28
-rw-r--r--README7
-rwxr-xr-xindex.pl90
3 files changed, 125 insertions, 0 deletions
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..29ba8e3
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,28 @@
+# ipv6test (c) 2010, Dipl.-Inform. (FH) Paul Buetow
+#
+# E-Mail: ipv6test@mx.buetow.org WWW: http://dev.buetow.org
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of buetow.org nor the names of its contributors may
+# be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED Paul Buetow ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT Paul C. Buetow BE LIABLE FOR ANY DIRECT,
+# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
diff --git a/README b/README
new file mode 100644
index 0000000..aa67c4c
--- /dev/null
+++ b/README
@@ -0,0 +1,7 @@
+This is a quick and dirty perl based IPv6 test website.
+
+It needs the following hosts configured:
+
+ipv6.buetow.org (IPv4 and IPv6)
+test4.ipv6.buetow.org (IPv4 only)
+test6.ipv6.buetow.org (IPv6 only)
diff --git a/index.pl b/index.pl
new file mode 100755
index 0000000..9bc44e5
--- /dev/null
+++ b/index.pl
@@ -0,0 +1,90 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Shell qw(host dig);
+
+print <<END;
+Content-type: text/html
+
+<html>
+<head>
+<title>The Ultimate IPv6 Test Site</title>
+ <script type="text/javascript">
+ var pkBaseURL = (("https:" == document.location.protocol) ? "https://ssl.buetow.org/stats/" : "http://ssl.buetow.org/stats/");
+ document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
+ </script><script type="text/javascript">
+ try {
+ var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
+ piwikTracker.trackPageView();
+ piwikTracker.enableLinkTracking();
+ } catch( err ) {}
+ </script><noscript><p><img src="http://ssl.buetow.org/stats/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
+</head>
+<body>
+
+Congratulations, you have connected to a server that will display your method of connection, either IPv6 (preferred) or IPv4 (old and crusty). Well IPv6 is already ~15 years old either but not as old as IPv4 ;)
+<br /><br />
+Nevertheless, please choose your destiny:
+<ul>
+ <li><a href="http://ipv6.buetow.org">ipv6.buetow.org</a> for IPv6 & IPv4 Test</li>
+ <li><a href="http://test4.ipv6.buetow.org">test4.ipv6.buetow.org</a> for IPv4 Only Test</li>
+ <li><a href="http://test6.ipv6.buetow.org">test6.ipv6.buetow.org</a> for IPv6 Only Test</li>
+</ul>
+If your browser times-out when trying to connect to this server then you do not have an IPv6 or IPv4 path (depends on which test you are running) to the server. If your browser returns an error that the host cannot be found then the DNS servers you are using are unable to resolve the AAAA or A DNS record (depends on which test you are running again) for the server. If your browser is able to connect to the "IPv6 Only Test", yet using the "IPv6 & IPv4 Test" returns a page stating you are using IPv4, then your browser and/or IP stack in your machine are preferring IPv4 over IPv6. It also might be that your operating system supports IPv6 but your web-browser doesn't.
+END
+
+if ($ENV{SERVER_NAME} eq 'ipv6.buetow.org') {
+ print "<h3>IPv6 & IPv4 Test Results:</h3>\n";
+
+} elsif ($ENV{SERVER_NAME} eq 'test6.ipv6.buetow.org') {
+ print "<h3>IPv6 Only Test Results:</h3>\n";
+
+} elsif ($ENV{SERVER_NAME} eq 'test4.ipv6.buetow.org') {
+ print "<h3>IPv4 Only Test Results:</h3>\n";
+}
+
+print "<pre>You are using <b>" . do {
+ if ($ENV{REMOTE_ADDR} =~ /(?:\d+\.){3}\d/) {
+ 'IPv4'
+ } else {
+ 'IPv6'
+ }
+} . "</b>\n";
+
+
+chomp (my $remote = host($ENV{REMOTE_ADDR}));
+chomp (my $server = host($ENV{SERVER_ADDR}));
+chomp (my $server0 = host($ENV{SERVER_NAME}));
+chomp (my $digremote = dig('-x', $ENV{REMOTE_ADDR}));
+chomp (my $digserver = dig('-x', $ENV{SERVER_ADDR}));
+chomp (my $digserver0 = dig('-t', 'any', $ENV{SERVER_NAME}));
+
+print <<END;
+Client address: $ENV{REMOTE_ADDR}
+Server address: $ENV{SERVER_ADDR}
+
+<b>Client address reverse DNS lookup:</b>
+$remote
+
+<b>Server address reverse DNS lookup:</b>
+$server
+
+<b>Server hostname DNS lookup:</b>
+$server0
+
+<b>Advanced client address reverse DNS lookup:</b>
+$digremote
+
+<b>Advanced server address reverse DNS lookup:</b>
+$digserver
+
+<b>Advanced server hostname DNS lookup:</b>
+$digserver0
+</pre>
+<hr />
+Thanks for visiting, please recommend this test to your friends and colleagues. Any comments go to <a href="http://contact.buetow.org">Paul Buetow</a>.
+</body>
+</html>
+END