Forwarding change
[mistral.git] / examples / hello_world.php
blob32a96fcbf084dd5dad9b2b7e108c140cdf7d311f
1 <?php
2 function my_cool_callback($requests) {
3 /* Takes as argument: status_code, body, and all other headers. The above, string based still works too. */
5 return array('status_code' => '200 OK', 'connection' => 'close', 'content-type' => 'text/plain', 'body' => print_r($requests, true));
8 # Bind Webserver on all ips with port 8802, timeout > 0 == keep-alive
9 mistral_init('0.0.0.0', 6901, 0);
11 # Setup callback function which gets called after each client request
12 mistral_register_callback("my_cool_callback");
14 # Start serving
15 mistral_start();