diff --git a/tiny_httpd/Tiny_httpd_core/Server/module-type-UPGRADE_HANDLER/index.html b/tiny_httpd/Tiny_httpd_core/Server/module-type-UPGRADE_HANDLER/index.html index fe0d9e6f..3c881c7d 100644 --- a/tiny_httpd/Tiny_httpd_core/Server/module-type-UPGRADE_HANDLER/index.html +++ b/tiny_httpd/Tiny_httpd_core/Server/module-type-UPGRADE_HANDLER/index.html @@ -1,7 +1,5 @@ -
Server.UPGRADE_HANDLERHandler that upgrades to another protocol.
val handshake : unit Request.t -> (Headers.t * handshake_state, string) resultPerform the handshake and upgrade the connection. The returned code is 101 alongside these headers. In case the handshake fails, this only returns Error log_msg. The connection is closed without further ado.
val handle_connection :
+UPGRADE_HANDLER (tiny_httpd.Tiny_httpd_core.Server.UPGRADE_HANDLER) Module type Server.UPGRADE_HANDLER
Handler that upgrades to another protocol.
val handshake :
Unix.sockaddr ->
- handshake_state ->
- IO.Input.t ->
- IO.Output.t ->
- unitTake control of the connection and take it from ther.e
+ unit Request.t ->
+ (Headers.t * handshake_state, string) resultPerform the handshake and upgrade the connection. This returns either Ok (resp_headers, state) in case of success, in which case the server sends a 101 response with resp_headers; or it returns Error log_msg if the the handshake fails, in which case the connection is closed without further ado and log_msg is logged locally (but not returned to the client).
val handle_connection : handshake_state -> IO.Input.t -> IO.Output.t -> unitTake control of the connection and take it from ther.e
Tiny_httpd_wsWebsockets for Tiny_httpd.
This sub-library (tiny_httpd.ws) exports a small implementation for a websocket server. It has no additional dependencies.
type handler =
- Unix.sockaddr ->
+ unit Tiny_httpd_core.Request.t ->
Tiny_httpd_core.IO.Input.t ->
Tiny_httpd_core.IO.Output.t ->
unitWebsocket handler