mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-05 19:00:32 -05:00
detail in example
This commit is contained in:
parent
075ad0825a
commit
f3461cfd21
1 changed files with 3 additions and 1 deletions
|
|
@ -134,6 +134,7 @@ let setup_upload server : unit =
|
|||
let () =
|
||||
let port_ = ref 8080 in
|
||||
let j = ref 32 in
|
||||
let addr = ref "127.0.0.1" in
|
||||
Arg.parse
|
||||
(Arg.align
|
||||
[
|
||||
|
|
@ -141,11 +142,12 @@ let () =
|
|||
"-p", Arg.Set_int port_, " set port";
|
||||
"--debug", Arg.Unit setup_logging, " enable debug";
|
||||
"-j", Arg.Set_int j, " maximum number of connections";
|
||||
"--addr", Arg.Set_string addr, " binding address";
|
||||
])
|
||||
(fun _ -> raise (Arg.Bad ""))
|
||||
"echo [option]*";
|
||||
|
||||
let server = Tiny_httpd.create ~port:!port_ ~max_connections:!j () in
|
||||
let server = Tiny_httpd.create ~addr:!addr ~port:!port_ ~max_connections:!j () in
|
||||
|
||||
Tiny_httpd_camlzip.setup ~compress_above:1024 ~buf_size:(16 * 1024) server;
|
||||
let m_stats, get_stats = middleware_stat () in
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue