diff --git a/src/index.html b/src/index.html index fa735e6..993b796 100644 --- a/src/index.html +++ b/src/index.html @@ -39,7 +39,7 @@

This is a libp2p-websocket-star signalling-server

if (f.hostname.startsWith('[') && f.hostname.endsWith(']')) f.h = f.hostname.match(/\[(.+)\]/)[1] else f.h = f.hostname f.protoport = f.port ? f.port : f.protocol == 'https:' ? 443 : 80 - if (f.port && ipv4Regex.test()) { + if (f.port && ipv4Regex.test(f.h)) { addr += '/ip4/' + f.h + '/tcp/' + f.port + '/' } else if (f.port && ipv6Regex.test(f.h)) { addr += '/ip6/' + f.h + '/tcp/' + f.port + '/'