(************************************************************ helloserver.ml Created : Mon Oct 30 23:26:33 2006 Last modified: Mon Oct 30 23:26:57 2006 Compile: ocamlc -dtypes unix.cma helloserver.ml -o helloserver # FTP Directory: sources/ocaml # ************************************************************) (** @author Takashi Masuyama *) open Unix let port = 8081 let addrstr = "127.0.0.1" let main () = let addr = ADDR_INET (inet_addr_of_string addrstr, port) in let f i o = output_string o "HTTP 1.1 OK\r\nContent-Type: text/plain\r\n\r\nhello" in establish_server f addr let _ = main () (* * Local Variables: * namazu-default-dir:"/home/tak/.indexes/ocaml" * End: *)