Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Aug 25, 2024
1 parent 68550de commit 1fd9cda
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
7 changes: 1 addition & 6 deletions eio/httpun_ws_eio.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ let sha1 s =
|> Digestif.SHA1.to_raw_string

module Server = struct
(* TODO: should this error handler be a websocket error handler or an HTTP
* error handler?*)
let create_connection_handler
?(config = Httpun.Config.default)
?error_handler
~sw
websocket_handler =
?(config = Httpun.Config.default) ?error_handler ~sw websocket_handler =
fun client_addr socket ->
let connection =
Httpun_ws.Server_connection.create
Expand Down
21 changes: 10 additions & 11 deletions eio/httpun_ws_eio.mli
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
open Httpun_ws

module Server : sig

val create_connection_handler
: ?config : Httpun.Config.t
-> ?error_handler : (Eio.Net.Sockaddr.stream -> Httpun.Server_connection.error_handler)
: ?config: Httpun.Config.t
-> ?error_handler: (Eio.Net.Sockaddr.stream -> Httpun.Server_connection.error_handler)
-> sw:Eio.Switch.t
-> (Eio.Net.Sockaddr.stream -> Wsd.t -> Websocket_connection.input_handlers)
-> (Eio.Net.Sockaddr.stream -> _ Eio.Net.stream_socket -> unit)
Expand All @@ -15,14 +14,14 @@ module Client : sig

(* Perform HTTP/1.1 handshake and upgrade to WS. *)
val connect
: ?config : Httpun.Config.t
-> sw : Eio.Switch.t
-> nonce : string
-> host : string
-> port : int
-> resource : string
-> error_handler : (Client_connection.error -> unit)
-> websocket_handler : (Wsd.t -> Websocket_connection.input_handlers)
: ?config:Httpun.Config.t
-> sw:Eio.Switch.t
-> nonce:string
-> host:string
-> port:int
-> resource:string
-> error_handler:(Client_connection.error -> unit)
-> websocket_handler:(Wsd.t -> Websocket_connection.input_handlers)
-> Eio_unix.Net.stream_socket_ty Eio.Net.stream_socket
-> t

Expand Down

0 comments on commit 1fd9cda

Please sign in to comment.