diff --git a/tunnel/link.cgi b/tunnel/link.cgi index 99149e256..42cb7912a 100755 --- a/tunnel/link.cgi +++ b/tunnel/link.cgi @@ -10,7 +10,7 @@ $ENV{'PATH_INFO'} =~ /^\/(http|https):\/+([^:\/]+)(:(\d+))?(.*)$/ || $protocol = $1; $ssl = $protocol eq "https"; $host = $2; -$port = $4 || 80; +$port = $4 || ( !$ssl ? 80 : 443 ); $path = $5 || "/"; $openurl = "$1://$2$3$5"; $baseurl = "$1://$2$3";