2 function my_cool_callback($requests) {
3 /* Takes as argument: status_code, body, and all other headers. The above, string based still works too. */
4 return array('status_code' => '200 OK', 'connection' => 'close', 'content-type' => 'text/plain', 'body' => 'Hello World!');
9 # Bind Webserver on every ip with the port, timeout > 0 == keep-alive
10 mistral_init('0.0.0.0', $port, 0);
12 # Setup callback function which gets called after each client request
13 mistral_register_callback("my_cool_callback");
15 echo "Mistral Listening on port $port\n";