summaryrefslogtreecommitdiffstats
path: root/webclients/index.vnc
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2012-04-02 16:30:53 +0200
committerChristian Beier <dontmind@freeshell.org>2012-04-02 16:30:53 +0200
commitefcdab50cc10ad121653bfff0da441495af461d3 (patch)
tree4a758a7c8caaf070ac14efa80411d00aac1ab3b7 /webclients/index.vnc
parentee4593425f63821280162d4e66a091479038a652 (diff)
parent2d50fc84f7ba869767ce052aa2aa9b11a104e0de (diff)
downloadlibtdevnc-efcdab50cc10ad121653bfff0da441495af461d3.tar.gz
libtdevnc-efcdab50cc10ad121653bfff0da441495af461d3.zip
Merge branch 'server-ipv6'
Diffstat (limited to 'webclients/index.vnc')
-rw-r--r--webclients/index.vnc10
1 files changed, 9 insertions, 1 deletions
diff --git a/webclients/index.vnc b/webclients/index.vnc
index 8254a70..0a92bd4 100644
--- a/webclients/index.vnc
+++ b/webclients/index.vnc
@@ -22,7 +22,15 @@ If the above Java applet does not work, you can also try the new JavaScript-only
<script language="JavaScript">
<!--
function start_novnc(){
- open("novnc/vnc_auto.html?host=" + document.location.hostname + "&port=$PORT&true_color=1");
+ var host = document.location.hostname;
+ // If there are at least two colons in there, it is likely an IPv6 address. Check for square brackets and add them if missing.
+ if(host.search(/^.*:.*:.*$/) != -1) {
+ if(host.charAt(0) != "[")
+ host = "[" + host;
+ if(host.charAt(host.length-1) != "]")
+ host = host + "]";
+ }
+ open("novnc/vnc_auto.html?host=" + host + "&port=$PORT&true_color=1");
}
-->
</script>