11 chdir $FindBin::Bin; # chdir to the directory of this perl script
13 my $d = new HTTP::Daemon LocalPort => 8085
14 or die "Error: port 8085 not available.";
15 print "Please contact me at: <URL:", $d->url, ">\n";
17 my $IsProofCheckerLiving = 0;
21 print stderr "\nERROR: The proof-checker died.\n";
22 $IsProofCheckerLiving=0;
27 open3(*PC_IN, *PC_OUT, *PC_ERR, "./proofChecker.opt 2>&1");
28 $IsProofCheckerLiving=1;
29 print stderr "\nWARNING: A new proof-checker starts.\n";
32 while (my $c = $d->accept) {
33 my $r = $c->get_request;
34 my $http_query = uri_unescape($r->url->query);
35 my $cgi = new CGI("$http_query");
36 my $uri = $cgi->param('uri');
38 if ($r->method eq 'GET' && $r->url->path eq "/proofCheck"){
39 print "Request to proof-check \"$uri\"...";
44 <title>Proof-Checking $uri</title>
46 <body bgcolor="white">
47 <h1>Proof-Checking $uri:</h1>
49 while(chomp($_ = <PC_OUT>)) {
50 last if ($_ eq "END");
60 print "INVALID REQUEST \"$http_query\"!!!!!\n\n";
61 $c->send_error(RC_FORBIDDEN);
65 last unless $IsProofCheckerLiving;