Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Eyal Sela
@EyalSel
I will have a go at it right now
Rudi Grinberg
@rgrinberg
why is it like that? so that you don’t >>= on the server value waiting for it to “finish"
because it won't
it will keep listening on the port
Eyal Sela
@EyalSel
right, which is what it would be expected to do
I will have a stab at it right now, thanks for the help
I will post here if I have any more queries. I should have read the documentation better before writing here haha
Rudi Grinberg
@rgrinberg
NP
Eyal Sela
@EyalSel
Perfect, thank you
I'm rusty on async
but it worked, many thanks
Rudi Grinberg
@rgrinberg
:+1:
Ilja Sidoroff
@isido
I'm just getting familiar with cohttp and I'm trying to make a simple GET request like this: let get_uri uri_str = Cohttp_async.Client.get @@ Uri.of_string uri_str >>= fun (_, body) -> Cohttp_async.Body.to_string body
It works for http, but not for https, where I get exception: Exception: Async_kernel.Monitor.Error_ _.
It has something to do with ssl_config -parameter, perhaps?
Anton Kulaga
@antonkulaga
Hi all! I wonder, has anybody succeeded running ocaml-http on windows?
Ilja Sidoroff
@isido
Never mind, I noticed someone answered that already above. I still cannot get it to work though, but probably just missing some require.
Rudi Grinberg
@rgrinberg
@isido do you have async_ssl installed?
Ilja Sidoroff
@isido
@rgrinberg I have. Perhaps it has something to do with conduit or underlying SSL/TLS implementations. Or do I need to #require more than "cohttp.async"?
Anton Kulaga
@antonkulaga
So, has anybody managed to build and run ocaml-http for windows?
Eyal Sela
@EyalSel
Hi, is anyone here?
Eyal Sela
@EyalSel
@rgrinberg are you around?
Eyal Sela
@EyalSel
trying one more time
anyone around?
Anil Madhavapeddy
@avsm
@antonkulaga yes windows should work fine with cygwin as far as I know
Anton Kulaga
@antonkulaga
@avsm last time I had issues building a project with it from windows. I do not have windows at home so I cannot check now
Manas
@prometheansacrifice

Hey everyone. I just got started with OCaml and was trying out cohttp. In the example, I could not understand >|= operator in the server example

  body |> Cohttp_lwt_body.to_string >|= (fun body ->
    (Printf.sprintf "Uri: %s\nMethod: %s\nHeaders\nHeaders: %s\nBody: %s"
                    uri meth headers body))

I know this is no place for discussing OCaml syntax, but any help would be appreciated.

Rudi Grinberg
@rgrinberg
x >|= f is equivalent to Lwt.map f x. It's not special syntax, just an operator defined in the Lwt.Infix module.
Sergei Lebedev
@superbobry
Is there an easy way to log all incoming requests with cohttp? Ofc I could just do it manually, but maybe there's something builtin?
Sergei Lebedev
@superbobry
And an unrelated question: are the API docs hosted somewhere? Update: found them by looking at the Makefile. Could you link to them in the README? http://mirage.github.io/ocaml-cohttp
Pavel Argentov
@argent-smith
Hello ppl. Q: when does Cohttp_lwt_unix.get close the connected socket?
Rudi Grinberg
@rgrinberg
once it gets the response and reads the entire body.
Pavel Argentov
@argent-smith
‘cause i have a quite simple lwt tail-recursive «loop» GETting responses and it looks like all the handles are kept open in CLOSE_WAIT state.
Pavel Argentov
@argent-smith
found drain_body. resolved )
Ciaran Courtney
@ciarancourtney
Hi, I'm writing my masters thesis on benchmarking various unikernel HTTP servers. When I try build the basic HTTP server from here https://github.com/mirage/ocaml-cohttp#basic-server-tutorial I get the error
``
ocamlfind: Packagecohttp-lwt-unix' not found
Cannot run Ocamlfind.`
I'm using the latest Ocaml/mirage on ubuntu 16.04
Ciaran Courtney
@ciarancourtney
OK resolved that by installing the package
But now I just get Circular build detected (server.cmi already seen in [ server.cmi ])
Ciaran Courtney
@ciarancourtney
Notwithstanding the previous issues, is there something backwards incompatible with the network based mirage-skeleton examples with the latest release of mirage? mirage/mirage-skeleton#234
Ciaran Courtney
@ciarancourtney
Resolved Circular build detected (server.cmi already seen in [ server.cmi ]) issue above, renaming server_example.ml to server.ml caused the issue
Rauan Mayemir
@rauanmayemir
hey everyone. is there an example of a client consuming a stream and parsing chunks?
Rauan Mayemir
@rauanmayemir
@SGrondin hey man, thanks. think i'm gonna check out the whole lib
Simon Grondin
@SGrondin
It's not ready for prime time, it's still in development
Rauan Mayemir
@rauanmayemir
as a newbie, i still can't make sense of that code
Qian Huang
@q-hwang
Hi! Does anyone know how to resolve the error: Fatal error: exception (Failure "No SSL or TLS support compiled into Conduit")?
Fabian
@copy
@q-hwang Most likely opam install lwt_ssl or opam show async_ssl depending on your choice of async framework
Qian Huang
@q-hwang
@copy Got it, thanks!
FofeuLabs
@FofeuLabs
Hello, has cohttp support for OAuth 1.0 ? If not, is there a recommended library ?