let callback path args outchan =
match path with
| "/gone" ->
- Http.Daemon.respond_redirect
+ Http_daemon.respond_redirect
~location:"/foo" ~body:"REDIRECT" ~code:302 outchan
| "/error" ->
- Http.Daemon.respond_error ~body:"ERROR" ~code:500 outchan
+ Http_daemon.respond_error ~body:"ERROR" ~code:500 outchan
| _ ->
begin
- Http.Daemon.send_basic_headers ~code:200 outchan;
- Http.Daemon.send_CRLF outchan;
+ Http_daemon.send_basic_headers ~code:200 outchan;
+ Http_daemon.send_CRLF outchan;
output_string outchan (dump_args path args)
end
in
-print_endline "Starting custom Http.Daemon ...";
+print_endline "Starting custom Http_daemon ...";
flush stdout;
-Http.Daemon.start ~addr:"127.0.0.1" ~port:9999 callback
+Http_daemon.start ~addr:"127.0.0.1" ~port:9999 callback