]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/ocaml-http/examples/client_address.ml
ocaml 3.09 transition
[helm.git] / helm / DEVEL / ocaml-http / examples / client_address.ml
index 75719111e799a06ad9c0472eab24c8dd15d86881..79d4ff836420f5f69c91b302acd8330827cba274 100644 (file)
@@ -2,7 +2,7 @@
 (*
   OCaml HTTP - do it yourself (fully OCaml) HTTP daemon
 
-  Copyright (C) <2002> Stefano Zacchiroli <zack@cs.unibo.it>
+  Copyright (C) <2002-2004> Stefano Zacchiroli <zack@cs.unibo.it>
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -19,7 +19,8 @@
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *)
 
-open Printf;;
+open Printf
+open Http_types
 
 let callback req outchan =
   let body =
@@ -30,5 +31,12 @@ let callback req outchan =
   in
   let res = new Http_response.response ~body () in
   Http_daemon.respond_with res outchan
-in
-Http_daemon.start' ~port:9999 callback
+
+let spec =
+  { Http_daemon.default_spec with
+      callback = callback;
+      port = 9999
+  }
+
+let _ = Http_daemon.main spec
+