From 9b890464b8c53d7fb6d11d736d940cb53c2b3856 Mon Sep 17 00:00:00 2001 From: Daniel Roesler Date: Thu, 16 Jul 2015 05:49:29 -0700 Subject: [PATCH] added IPv6 detection --- README.md | 2 +- index.html | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 396c77a..c331650 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ function getIPs(callback){ function handleCandidate(candidate){ //match just the IP address - var ip_regex = /([0-9]{1,3}(\.[0-9]{1,3}){3})/ + var ip_regex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/ var ip_addr = ip_regex.exec(candidate)[1]; //remove duplicates diff --git a/index.html b/index.html index 004ae66..3e8569c 100644 --- a/index.html +++ b/index.html @@ -19,6 +19,8 @@

Your public IP addresses:

+

Your IPv6 addresses:

+