This commit is contained in:
int 80h
2020-05-17 00:17:35 -04:00
parent 5c7f0f2275
commit e9f71f600d
7 changed files with 153 additions and 27 deletions

16
cgi-scripts/scgi/scgi.pl Executable file
View 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";
}