2 function my_cool_callback($requests) {
3 $requests['HTTP_CONNECTION'] = isset($requests['HTTP_CONNECTION']) ?
$requests['HTTP_CONNECTION'] : 'close';
5 $output = print_r($requests, true);
7 $answer = array('status_code' => '200 OK',
8 'connection' => $requests['HTTP_CONNECTION'],
9 'content-type' => 'text/plain',
10 'content-length' => strlen($output),
17 # Bind Webserver on all ips with port 8081, timeout > 0 == keep-alive
18 mistral_init('0.0.0.0', $port, 2);
20 # Setup callback function which gets called after each client request
21 mistral_register_callback("my_cool_callback");
23 echo "Mistral Listening on port $port\n";