Commit graph

29 commits

Author SHA1 Message Date
Simon Cruanes
a405fb046d
expose client address to websocket 2024-02-05 01:07:34 -05:00
Simon Cruanes
d3a4dbc5b0
feat server: new notion of Upgrade handler
this handles `connection: upgrade` endpoints with a generic
connection-oriented handler. The main goal is to support
websockets.
2024-02-05 01:06:37 -05:00
Simon Cruanes
df8b579d24
feat: add Response_code.is_success 2024-01-24 13:11:47 -05:00
Simon Cruanes
ce00f7a027
prepare for 0.16 2024-01-23 23:32:52 -05:00
Simon Cruanes
86f1b9025d
add optional dependency on logs 2024-01-23 23:32:20 -05:00
barti2du
8d7dd43ba1 request: Make client_addr public 2023-12-19 12:29:16 -05:00
Simon Cruanes
ac1c1ab502
prepare for 0.14 2023-08-08 16:49:19 -04:00
Simon Cruanes
7365dfcdd5
doc 2023-08-08 16:37:38 -04:00
Simon Cruanes
402e3f72e4
breaking: set_top_handler takes a stream request, for more generality 2023-08-08 16:36:17 -04:00
Stéphane Lavergne
03596c1a08 Remove option around client_addr 2023-08-08 15:18:39 -04:00
Stéphane Lavergne
d5f783c159
Comment re: NEXT_RELEASE
Co-authored-by: Simon Cruanes <simon.cruanes.2007@m4x.org>
2023-08-08 15:00:20 -04:00
Simon Cruanes
1e50abb44f
Merge branch 'master' into client-ip 2023-08-08 13:03:40 -04:00
Stéphane Lavergne
1b7939c17a Pass code to response makers
Error codes still override it.
2023-08-08 12:35:42 -04:00
Stéphane Lavergne
53182375c0 Preserve client address down to Request.t
Note that the argument is optional because of the Internal_ use case.
2023-08-07 16:52:32 -04:00
Simon Cruanes
de23d9b2a3
wip: add IO.Writer.t, a push based stream
This is more convenient than our existing streams when it comes to
writing a body. The user can just get an output channel and write to it,
flush it, etc. as they please. This should also simplify compression…
once it works.
2023-07-11 10:57:08 -04:00
Simon Cruanes
832c4bd4df
more docs 2023-07-11 10:01:39 -04:00
Simon Cruanes
ec2f2f6f2e
add Server.run_exn 2023-07-11 10:01:33 -04:00
Simon Cruanes
b9faebffe4 use a resource pool to recycle buffers 2023-06-23 17:58:11 -04:00
Simon Cruanes
79cbcca4c1
cleanup: remove unused function in Tiny_httpd_server.IO_BACKEND 2023-06-21 00:23:11 -04:00
Simon Cruanes
5d7637becc
server: add IO_BACKEND abstraction; implement a unix version of it
this doesn't change the `create`+`run` version, but makes it possible to
create a server that doesn't use unix IOs.
2023-06-20 23:03:31 -04:00
Simon Cruanes
ac17e61a81
prepare for 0.13 2023-05-24 16:14:13 -04:00
Simon Cruanes
202ef14f59
doc 2023-05-24 15:42:32 -04:00
Simon Cruanes
aa27963c5a
improve docs 2023-05-24 15:39:05 -04:00
Simon Cruanes
88bfb9c109
feat: Server.run takes ?after_init parameter
also use it in http_of_dir to print the actual port.
2023-05-24 15:38:38 -04:00
Simon Cruanes
0908d71e19
ocamlformat 2023-05-23 17:40:18 -04:00
Simon Cruanes
997f7aa868
expose Response.make_void
it only has no body if the http code is compatible with it.
close #62
2023-05-23 17:18:05 -04:00
Stephane Legrand
9c2cf0900d Add OPTIONS method 2023-05-07 20:55:46 -04:00
Simon Cruanes
91e835ea60
docstrings 2022-03-30 12:55:03 -04:00
Simon Cruanes
d5f9eacc81 split code into more modules 2022-03-16 20:40:38 -04:00