Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 27 lines (22 sloc) 0.711 kB
#!/usr/bin/env perl6
###############################################################################
#
# Test script using raw HTTP responses, and its own request loop.
#
###############################################################################
use SCGI;
my $scgi = SCGI.new( :port(8118), :!PSGI );
say "Starting raw SCGI server.";
while (my $connection = $scgi.accept())
{
my $request = $connection.request;
if $request.success
{
my $name = $request.env<QUERY_STRING> || 'World';
my $return = "Hello $name\n";
my $len = $return.encode.bytes;
my $headers = "Content-Type: text/plain\nContent-Length: $len\n";
$connection.send("$headers\n$return");
}
$connection.close;
}
Jump to Line
Something went wrong with that request. Please try again.