SCGI
This commit is contained in:
16
cgi-scripts/scgi/scgi.pl
Executable file
16
cgi-scripts/scgi/scgi.pl
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
|
||||
use SCGI;
|
||||
use IO::Socket;
|
||||
|
||||
my $socket = IO::Socket::INET->new(Listen => 5, ReuseAddr => 1, LocalPort => 4001)
|
||||
or die "cannot bind to port 4001: $!";
|
||||
|
||||
my $scgi = SCGI->new($socket, blocking => 1);
|
||||
|
||||
while (my $request = $scgi->accept) {
|
||||
$request->read_env;
|
||||
read $request->connection, my $body, $request->env->{CONTENT_LENGTH};
|
||||
print { $request->connection } "20\ttext/gemini\r\nperl\n";
|
||||
}
|
||||
Reference in New Issue
Block a user