File: use-ipv6.pl

package info (click to toggle)
lighttpd 1.4.69-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,328 kB
  • sloc: ansic: 92,571; sh: 5,169; perl: 2,616; makefile: 738; yacc: 729
file content (17 lines) | stat: -rwxr-xr-x 382 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /usr/bin/perl -w

use Socket;
use strict;

my $sock;
my $PORT = 80;
$PORT = $ARGV[0] if $ARGV[0] and $ARGV[0] >= 0 and $ARGV[0] <= 65535;

if (socket($sock, AF_INET6, SOCK_STREAM, 0)) {
    if ($PORT == 443) {
        print qq/\$SERVER["socket"] == "[::]:$PORT" {\nssl.engine = "enable"\n}\n/;
    }
    else {
        print qq/\$SERVER["socket"] == "[::]:$PORT" { }\n/;
    }
}