package_name stringlengths 2 45 | version stringclasses 286
values | license stringclasses 47
values | homepage stringclasses 341
values | dev_repo stringclasses 342
values | file_type stringclasses 6
values | file_path stringlengths 6 151 | file_content stringlengths 0 58.3M |
|---|---|---|---|---|---|---|---|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | opam | cohttp-6.2.1/cohttp-async.opam | version: "6.2.1"
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "CoHTTP implementation for the Async concurrency library"
description: """
An implementation of an HTTP client and server using the Async
concurrency library. See the `Cohttp_async` module for information
on how t... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-async/bin/cohttp_curl_async.ml | (*{{{ Copyright (c) 2014 Anil Madhavapeddy <anil@recoil.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" A... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-async/bin/cohttp_server_async.ml | (*{{{ Copyright (c) 2013 Anil Madhavapeddy <anil@recoil.org>
* Copyright (c) 2014 David Sheets <sheets@alum.mit.edu>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appea... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-async/bin/dune | (executables
(names cohttp_curl_async cohttp_server_async)
(libraries
cohttp-async
async_kernel
async.async_command
async_unix
base
cohttp
cohttp_server
fmt.tty
core_unix.command_unix))
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-async/examples/dune | (executables
(names hello_world receive_post)
(libraries
digestif.c
http
cohttp-async
base
async_kernel
core_unix.command_unix))
(alias
(name runtest)
(package cohttp-async)
(deps hello_world.exe receive_post.exe))
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-async/examples/hello_world.ml | (* This file is in the public domain *)
open Core
open Async_kernel
module Server = Cohttp_async.Server
(* given filename: hello_world.ml compile with:
$ corebuild hello_world.native -pkg cohttp.async
*)
let handler ~body:_ _sock req =
let uri = Cohttp.Request.uri req in
match Uri.path uri with
| "/test" ->
... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-async/examples/receive_post.ml | (* This file is in the public domain *)
open Base
open Async_kernel
module Body = Cohttp_async.Body
module Server = Cohttp_async.Server
(* compile with: $ corebuild receive_post.native -pkg cohttp.async *)
let start_server port () =
Stdlib.Printf.eprintf "Listening for HTTP on port %d\n" port;
Stdlib.Printf.eprin... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-async/examples/s3_cp.ml | (*{{{ Copyright (C) 2015 Trevor Smith <trevorsummerssmith@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-async/src/body.ml | open Base
open Async_kernel
module B = Cohttp.Body
type t = [ B.t | `Pipe of string Pipe.Reader.t ] [@@deriving sexp_of]
let empty = `Empty
let of_string s = (B.of_string s :> t)
let of_pipe p = `Pipe p
let to_string = function
| #B.t as body -> return (B.to_string body)
| `Pipe s -> Pipe.to_list s >>| String.co... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | mli | cohttp-6.2.1/cohttp-async/src/body.mli | open! Base
open! Async_kernel
type t = [ Cohttp.Body.t | `Pipe of string Pipe.Reader.t ] [@@deriving sexp_of]
include Cohttp.S.Body with type t := t
val to_string : t -> string Deferred.t
val to_string_list : t -> string list Deferred.t
val to_pipe : t -> string Pipe.Reader.t
val of_pipe : string Pipe.Reader.t -> t
... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-async/src/client.ml | open Base
open Async_kernel
open Async_unix
module Net = struct
let lookup uri =
let host = Uri.host_with_default ~default:"localhost" uri in
match Uri_services.tcp_port_of_uri ~default:"http" uri with
| None ->
Deferred.Or_error.error_string
"Net.lookup: failed to get TCP port form Uri... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | mli | cohttp-6.2.1/cohttp-async/src/client.mli | val request :
?interrupt:unit Async_kernel.Deferred.t ->
?ssl_config:Conduit_async.V2.Ssl.Config.t ->
?uri:Uri.t ->
?body:Body.t ->
Http.Request.t ->
(Http.Response.t * Body.t) Async_kernel.Deferred.t
(** Send an HTTP request with an arbitrary body The request is sent as-is. *)
val call :
?interrupt:unit... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-async/src/cohttp_async.ml | module Body = Body
module Body_raw = Body [@@deprecated "Use Body"]
module Client = Client
module Io = Io [@@deprecated "This module is not for public consumption"]
module Request = Cohttp.Request [@@deprecated "Use Cohttp.Request directly"]
module Response = Cohttp.Response [@@deprecated "Use Cohttp.Response directly"... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-async/src/dune | (library
(name cohttp_async)
(synopsis "Async backend")
(public_name cohttp-async)
(libraries
logs.fmt
base
fmt
async_unix
async_kernel
uri
uri.services
uri-sexp
ipaddr.unix
conduit-async
magic-mime
http
http_bytebuffer
cohttp)
(preprocess
(pps ppx_sexp_conv)))
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-async/src/input_channel.ml | open! Core
open! Async
module Bytebuffer = struct
module Bytebuffer = Http_bytebuffer.Bytebuffer
include Bytebuffer
include
Bytebuffer.Make
(Deferred)
(struct
type src = Reader.t
let refill reader buf ~pos ~len = Reader.read reader ~pos ~len buf
end)
end
type t = { buf : ... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | mli | cohttp-6.2.1/cohttp-async/src/input_channel.mli | open Async
type t
val create : ?buf_len:int -> Reader.t -> t
val read_line_opt : t -> string option Deferred.t
val read : t -> int -> string Deferred.t
val refill : t -> [ `Eof | `Ok ] Deferred.t
val with_input_buffer : t -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
val is_closed : t -> bool
val close : t ->... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-async/src/io.ml | (*{{{ Copyright (c) 2012-2013 Anil Madhavapeddy <anil@recoil.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS ... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | mli | cohttp-6.2.1/cohttp-async/src/io.mli | (*{{{ Copyright (c) 2013 Anil Madhavapeddy <anil@recoil.org>
*
* Permission to use, copy, modify, and distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies. THE SOFTWARE IS PROVIDED "AS IS" AND... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-async/src/server.ml | open Base
open Async_kernel
open Async_unix
type ('address, 'listening_on) t = {
server : ('address, 'listening_on) Tcp.Server.t; [@sexp.opaque]
}
[@@deriving sexp_of]
let num_connections t = Tcp.Server.num_connections t.server
type response = Cohttp.Response.t * Body.t [@@deriving sexp_of]
type response_action =... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | mli | cohttp-6.2.1/cohttp-async/src/server.mli | type ('address, 'listening_on) t
constraint 'address = [< Async_unix.Socket.Address.t ]
[@@deriving sexp_of]
val close : (_, _) t -> unit Async_kernel.Deferred.t
val close_finished : (_, _) t -> unit Async_kernel.Deferred.t
val is_closed : (_, _) t -> bool
val listening_on : (_, 'listening_on) t -> 'listening_on
val... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-async/test/cohttp_async_test/src/cohttp_async_test.ml | open Base
open Async_kernel
open OUnit
module Server = Cohttp_async.Server
module Body = Cohttp_async.Body
type 'a io = 'a Deferred.t
type ic = Async_unix.Reader.t
type oc = Async_unix.Writer.t
type body = Body.t
type response_action =
[ `Expert of Http.Response.t * (ic -> oc -> unit io)
| `Response of Http.Respo... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | mli | cohttp-6.2.1/cohttp-async/test/cohttp_async_test/src/cohttp_async_test.mli | open Async_kernel
include
Cohttp_test.S
with type 'a io = 'a Deferred.t
and type body = Cohttp_async.Body.t
and type ic = Async_unix.Reader.t
and type oc = Async_unix.Writer.t
val run_async_tests : OUnit.test io -> OUnit.test_result list Deferred.t
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-async/test/cohttp_async_test/src/dune | (library
(name cohttp_async_test)
(libraries fmt.tty uri.services async_kernel cohttp_test cohttp-async))
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-async/test/dune | (executable
(name test_async_integration)
(libraries
cohttp_async_test
async_unix
base
core
async_kernel
ounit2
cohttp-async))
(rule
(alias runtest)
(package cohttp-async)
(action
(run ./test_async_integration.exe)))
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-async/test/test_async_integration.ml | open Base
open Async_kernel
open OUnit
open Cohttp
open Cohttp_async_test
module Server = Cohttp_async.Server
module Client = Cohttp_async.Client
module Body = Cohttp_async.Body
let chunk_body = [ "one"; ""; " "; "bar"; "" ]
let large_string = String.make (Int.pow 2 16) 'A'
let response_bodies = [ "Testing"; "Foo bar"... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | opam | cohttp-6.2.1/cohttp-bench.opam | version: "6.2.1"
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "Benchmarks binaries for Cohttp"
description: """
This package contains some benchmarks for http and cohttp.
The benchmarks for the server latency will require wrk2
(https://github.com/giltene/wrk2) to run. The la... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-bench/async_server.ml | open Core
open Async
module Server = Cohttp_async.Server
let length = 2053
let text = String.make length 'a'
let headers = Cohttp.Header.of_list [ ("content-length", Int.to_string length) ]
let handler ~body:_ _sock _req = Server.respond_string ~headers text
let start_server port () =
Cohttp_async.Server.create ~on... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-bench/bench.ml | module Command = Core.Command
module Staged = Core.Staged
open Core_bench
let header_names =
[
"Accept";
"Accept-Encoding";
"Accept-Language";
"Cache-Control";
"Connection";
"Host";
"If-Modified-Since";
"If-None-Match";
"Origin";
"Referer";
"Sec-Fetch-Dest";
"Sec-Fetch... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-bench/dune | (executable
(name bench)
(modules bench)
(libraries http core core_unix.command_unix core_bench))
(executable
(name lwt_unix_server)
(modules lwt_unix_server)
(libraries cohttp-lwt-unix logs.fmt fmt.tty))
(executable
(name async_server)
(modules async_server)
(libraries cohttp-async core_unix.command_unix lo... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-bench/eio_server.ml | open Cohttp_eio
let length = 2053
let text = String.make length 'a'
let headers = Cohttp.Header.of_list [ ("content-length", Int.to_string length) ]
let server_callback _conn _req _body =
Server.respond_string ~headers ~status:`OK ~body:text ()
let () =
let port = ref 8080 in
Arg.parse
[ ("-p", Arg.Set_int... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-bench/lwt_unix_server.ml | module Server = Cohttp_lwt_unix.Server
let length = 2053
let text = String.make length 'a'
let headers = Cohttp.Header.of_list [ ("content-length", Int.to_string length) ]
let server_callback _conn _req _body =
Server.respond_string ~headers ~status:`OK ~body:text ()
let main () =
Server.create ~backlog:11_000 (... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-bench/lwt_unix_server_new.ml | open Lwt.Syntax
module Context = Cohttp_server_lwt_unix.Context
module Body = Cohttp_server_lwt_unix.Body
let text = String.make 2053 'a'
let server_callback ctx =
Lwt.join
[
Context.discard_body ctx;
Context.respond ctx (Http.Response.make ()) (Body.string text);
]
let main () =
let* _server... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | mli | cohttp-6.2.1/cohttp-bench/lwt_unix_server_new.mli | |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | opam | cohttp-6.2.1/cohttp-curl-async.opam | version: "6.2.1"
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "Cohttp client using Curl & Async as the backend"
description: """
An HTTP client that relies on Curl + Async for the backend. Does not require
conduit for SSL."""
maintainer: ["Anil Madhavapeddy <anil@recoil.org>... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-curl-async/bin/curl.ml | open Cohttp
module Curl = Cohttp_curl_async
module Sexp = Sexplib0.Sexp
open Async_kernel
module Writer = Async_unix.Writer
module Time = Core.Time_float
let ( let* ) x f = Deferred.bind x ~f
let client uri meth' () =
let meth = Cohttp.Code.method_of_string meth' in
let reply =
let context = Curl.Context.crea... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-curl-async/bin/dune | (executable
(name curl)
(libraries
sexplib0
cohttp
cohttp_curl_async
core_kernel
async_unix
async_kernel
async.async_command
core_unix.command_unix))
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-curl-async/src/cohttp_curl_async.ml | open Async_kernel
module Time = Core.Time_float
module Fd = Async_unix.Fd
module Clock = Async_unix.Clock
let ( let+ ) x f = Deferred.map x ~f
module Cohttp_curl = Cohttp_curl.Private
module Sink = Cohttp_curl.Sink
module Source = Cohttp_curl.Source
module Error = Cohttp_curl.Error
module Context = struct
type fd_... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | mli | cohttp-6.2.1/cohttp-curl-async/src/cohttp_curl_async.mli | (** Curl & Async based client *)
module Sink : sig
(** A sink defines where the response body may be written *)
type 'a t
val string : string t
val discard : unit t
end
module Source : sig
(** A source defines where the request body is read from *)
type t
val empty : t
val string : string -> t
end... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-curl-async/src/dune | (library
(name cohttp_curl_async)
(libraries http cohttp-curl core curl stringext async_kernel async_unix))
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-curl-async/test/cohttp_curl_async_tests.ml | module Server = Cohttp_async.Server
module Body = Cohttp_async.Body
module Deferred = Async_kernel.Deferred
open Async_kernel
let ( let+ ) x f = Deferred.map x ~f
let ( let* ) x f = Deferred.bind x ~f
let server =
List.map Cohttp_async_test.const
[
(let body : Body.t = Body.of_string "hello curl" in
... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-curl-async/test/dune | (test
(name cohttp_curl_async_tests)
(libraries
http
core_kernel
async_unix
uri
async_kernel
alcotest
cohttp_async_test
cohttp_curl_async)
(package cohttp-curl-async))
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | opam | cohttp-6.2.1/cohttp-curl-lwt.opam | version: "6.2.1"
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "Cohttp client using Curl & Lwt as the backend"
description: """
An HTTP client that relies on Curl + Lwt for the backend. Does not require
conduit for SSL."""
maintainer: ["Anil Madhavapeddy <anil@recoil.org>"]
a... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-curl-lwt/bin/curl.ml | open Lwt.Syntax
open Cohttp
module Curl = Cohttp_curl_lwt
module Sexp = Sexplib0.Sexp
let src =
Logs.Src.create "cohttp.lwt.curl" ~doc:"Cohttp Lwt curl implementation"
module Log = (val Logs.src_log src : Logs.LOG)
let client uri ofile meth' =
Log.debug (fun d -> d "Client with URI %s" (Uri.to_string uri));
le... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | mli | cohttp-6.2.1/cohttp-curl-lwt/bin/curl.mli | |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-curl-lwt/bin/dune | (executable
(name curl)
(libraries
sexplib0
cohttp
cohttp_curl_lwt
lwt.unix
lwt
logs
logs.cli
uri
fmt.tty
cmdliner))
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-curl-lwt/src/cohttp_curl_lwt.ml | (* {[
Copyright (c) 2003, Lars Nilsson, <lars@quantumchamaeleon.com>
Copyright (c) 2009, ygrek, <ygrek@autistici.org>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restric... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | mli | cohttp-6.2.1/cohttp-curl-lwt/src/cohttp_curl_lwt.mli | (** Curl based client *)
module Sink : sig
(** A sink defines where the response body may be written *)
type 'a t
val string : string t
val discard : unit t
end
module Source : sig
(** A source defines where the request body is read from *)
type t
val empty : t
val string : string -> t
end
module... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-curl-lwt/src/dune | (library
(name cohttp_curl_lwt)
(public_name cohttp-curl-lwt)
(libraries http cohttp-curl stringext lwt lwt.unix curl))
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-curl-lwt/test/cohttp_curl_lwt_tests.ml | module Server = Cohttp_lwt_unix.Server
module Body = Cohttp_lwt.Body
open Lwt.Syntax
open Lwt.Infix
let server =
List.map Cohttp_lwt_unix_test.const
[
(let body : Body.t = Body.of_string "hello curl" in
Server.respond ~status:`OK ~body ());
]
|> Cohttp_lwt_unix_test.response_sequence
let chec... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-curl-lwt/test/dune | (test
(name cohttp_curl_lwt_tests)
(libraries http alcotest uri cohttp_lwt_unix_test cohttp_curl_lwt)
(package cohttp-curl-lwt))
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | opam | cohttp-6.2.1/cohttp-curl.opam | version: "6.2.1"
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "Shared code between the individual cohttp-curl clients"
description: "Use cohttp-curl-lwt or cohttp-curl-async"
maintainer: ["Anil Madhavapeddy <anil@recoil.org>"]
authors: [
"Anil Madhavapeddy"
"Stefano Zacc... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-curl/src/cohttp_curl.ml | module Sink = struct
type _ t = String : string t | Discard : unit t
let string = String
let discard = Discard
end
module Error = struct
type t = Curl.curlCode
let create x = x
let is_timeout (t : t) =
match t with Curl.CURLE_OPERATION_TIMEOUTED -> true | _ -> false
let message t = Curl.strerror ... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | mli | cohttp-6.2.1/cohttp-curl/src/cohttp_curl.mli | module Private : sig
module Error : sig
type t
val create : Curl.curlCode -> t
val message : t -> string
val is_timeout : t -> bool
end
module Sink : sig
type 'a t
val string : string t
val discard : unit t
end
module Source : sig
type t
val empty : t
val string : ... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-curl/src/dune | (library
(name cohttp_curl)
(public_name cohttp-curl)
(libraries http curl stringext))
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | opam | cohttp-6.2.1/cohttp-eio.opam | version: "6.2.1"
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "CoHTTP implementation with eio backend"
description:
"A CoHTTP server and client implementation based on `eio` library. `cohttp-eio`features a multicore capable HTTP 1.1 server. The library promotes and is buil... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-eio/examples/client1.ml | open Cohttp_eio
let () = Logs.set_reporter (Logs_fmt.reporter ())
and () =
(* The eio backend does not leverage domains yet, but might in the near future *)
Logs_threaded.enable ()
and () = Logs.Src.set_level Cohttp_eio.src (Some Debug)
let () =
Eio_main.run @@ fun env ->
let client = Client.make ~https:Non... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-eio/examples/client_proxy.ml | open Cohttp_eio
let authenticator =
match Ca_certs.authenticator () with
| Ok x -> x
| Error (`Msg m) ->
Fmt.failwith "Failed to create system store X509 authenticator: %s" m
let () =
Logs.set_reporter (Logs_fmt.reporter ());
Logs_threaded.enable ();
Logs.Src.set_level Cohttp_eio.src (Some Debug)
l... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-eio/examples/client_timeout.ml | open Cohttp_eio
let () =
Eio_main.run @@ fun env ->
let client = Client.make ~https:None env#net in
(* Increment/decrement this value to see success/failure. *)
let timeout_s = 0.01 in
Eio.Time.with_timeout env#clock timeout_s (fun () ->
Eio.Switch.run @@ fun sw ->
let _, body =
Client.ge... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-eio/examples/client_tls.ml | open Cohttp_eio
let authenticator =
match Ca_certs.authenticator () with
| Ok x -> x
| Error (`Msg m) ->
Fmt.failwith "Failed to create system store X509 authenticator: %s" m
let () =
Logs.set_reporter (Logs_fmt.reporter ());
Logs_threaded.enable ();
Logs.Src.set_level Cohttp_eio.src (Some Debug)
l... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-eio/examples/docker_client.ml | module Switch = Eio.Switch
module Net = Eio.Net
module Stdenv = Eio.Stdenv
module Client = Cohttp_eio.Client
module Response = Http.Response
module Status = Http.Status
let () = Logs.set_reporter (Logs_fmt.reporter ())
and () = Logs.Src.set_level Cohttp_eio.src (Some Debug)
let () =
Eio_main.run @@ fun env ->
let... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-eio/examples/dune | (executables
(names
server1
server2
client1
docker_client
client_timeout
client_tls
client_proxy)
(libraries
cohttp-eio
cmdliner
eio_main
eio.unix
fmt
unix
logs.fmt
logs.threaded
tls-eio
ca-certs
mirage-crypto-rng.unix))
(alias
(name runtest)
(package cohttp-eio)
(deps server1.... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-eio/examples/server1.ml | let text =
"CHAPTER I. Down the Rabbit-Hole Alice was beginning to get very tired of \
sitting by her sister on the bank, and of having nothing to do: once or \
twice she had peeped into the book her sister was reading, but it had no \
pictures or conversations in it, <and what is the use of a book,> though... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-eio/examples/server2.ml | let () = Logs.set_reporter (Logs_fmt.reporter ())
and () = Logs.Src.set_level Cohttp_eio.src (Some Debug)
let ( / ) = Eio.Path.( / )
(* To stream a file, we take the extra [writer] argument explicitly.
This means that we stream the response while the function is still
running and the file is still open. *)
let ... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-eio/src/body.ml | type t = Eio.Flow.source_ty Eio.Resource.t
type 't Eio.Flow.read_method += String of ('t -> string)
module String_source = struct
type t = { s : string; mutable offset : int }
let single_read t dst =
if t.offset = String.length t.s then raise End_of_file;
let len = min (Cstruct.length dst) (String.length ... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-eio/src/client.ml | open Eio.Std
open Utils
module Proxy = Cohttp.Proxy.Forward
type connection = [ Eio.Flow.two_way_ty | Eio.Resource.close_ty ] r
type t = sw:Switch.t -> Uri.t -> connection
type proxies = (Uri.t, Uri.t) Proxy.servers
let proxies : (Http.Header.t option * proxies) option Atomic.t =
Atomic.make None
let set_proxies ?... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | mli | cohttp-6.2.1/cohttp-eio/src/client.mli | open Eio.Std
type t
include
Cohttp.Generic.Client.S
with type 'a with_context = t -> sw:Switch.t -> 'a
and type 'a io = 'a
and type body = Body.t
val make :
https:
(Uri.t ->
[ Eio.Flow.two_way_ty | Eio.Resource.close_ty ] Eio.Std.r ->
[> Eio.Resource.close_ty ] Eio.Flow.two_way)
opt... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-eio/src/cohttp_eio.ml | module Body = Body
module Client = Client
module Server = Server
module Private = struct
module IO = Io.IO
end
let src = Utils.src
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-eio/src/dune | (library
(name cohttp_eio)
(public_name cohttp-eio)
(libraries cohttp eio fmt http logs ptime uri uri.services ipaddr))
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-eio/src/io.ml | let src = Logs.Src.create "cohttp.eio.io" ~doc:"Cohttp Eio IO module"
module Logs = (val Logs.src_log src : Logs.LOG)
module IO = struct
type 'a t = 'a
let ( >>= ) v f = f v
let return v = v
type ic = Eio.Buf_read.t
type oc = Eio.Buf_write.t
type conn = Eio.Switch.t * Eio.Net.Sockaddr.stream
let refi... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | mli | cohttp-6.2.1/cohttp-eio/src/io.mli | module IO :
Cohttp.S.IO
with type 'a t = 'a
and type conn = Eio.Switch.t * Eio.Net.Sockaddr.stream
and type ic = Eio.Buf_read.t
and type oc = Eio.Buf_write.t
module Request :
Cohttp.S.Http_io with type t := Http.Request.t and module IO := IO
module Response :
Cohttp.S.Http_io with type t := H... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-eio/src/server.ml | open Utils
module IO = Io.IO
type body = Body.t
type conn = IO.conn * Cohttp.Connection.t [@@warning "-3"]
type writer = Http.Request.t * IO.oc
type response = writer -> unit
type response_action =
[ `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit)
| `Response of response ]
type t = {
conn_closed : conn -... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | mli | cohttp-6.2.1/cohttp-eio/src/server.mli | type writer
include
Cohttp.Generic.Server.S
with module IO = Io.IO
and type body = Body.t
and type response = writer -> unit
val respond :
?headers:Http.Header.t ->
status:Http.Status.t ->
body:_ Eio.Flow.source ->
unit ->
response IO.t
val run :
?max_connections:int ->
?additional_doma... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-eio/src/utils.ml | let src = Logs.Src.create "cohttp.eio" ~doc:"Cohttp Eio backend"
module Logs = (val Logs.src_log src)
module Reader_flow = struct
type t = {
read_body_chunk : unit -> Cohttp.Transfer.chunk;
mutable buffered : (string * int) option;
}
let v read_body_chunk = { read_body_chunk; buffered = None }
let s... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-eio/tests/dune | (test
(name test)
(modules test)
(libraries alcotest cohttp-eio eio eio.mock eio_main logs.fmt)
(package cohttp-eio)
(preprocess
(pps ppx_here)))
(test
(name test_forward_proxy)
(modules test_forward_proxy)
(libraries alcotest cohttp-eio eio eio.mock eio_main logs.fmt)
(package cohttp-eio))
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-eio/tests/test.ml | let () =
Logs.set_level ~all:true @@ Some Logs.Debug;
Logs.set_reporter (Logs_fmt.reporter ())
let handler _conn request body =
match Http.Request.resource request with
| "/" -> Cohttp_eio.Server.respond_string ~status:`OK ~body:"root" ()
| "/stream" ->
let body = Eio_mock.Flow.make "streaming body" in... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-eio/tests/test_forward_proxy.ml | (* Tests the core behaviour if the forward proxy *)
let () =
Logs.set_level ~all:true @@ Some Logs.Debug;
Logs.set_reporter (Logs_fmt.reporter ())
(* Used to pass data out of the server *)
module Req_data = struct
let side_channel : Http.Request.t Eio.Stream.t = Eio.Stream.create 1
let send t = Eio.Stream.add... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | opam | cohttp-6.2.1/cohttp-lwt-jsoo.opam | version: "6.2.1"
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "CoHTTP implementation for the Js_of_ocaml JavaScript compiler"
description: """
An implementation of an HTTP client for JavaScript, but using the
CoHTTP types. This lets you build HTTP clients that can compile
n... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-lwt-jsoo/src/cohttp_lwt_jsoo.ml | (*{{{ Copyright (c) 2014 Andy Ray
* Copyright (c) 2014 Anil Madhavapeddy <anil@recoil.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | mli | cohttp-6.2.1/cohttp-lwt-jsoo/src/cohttp_lwt_jsoo.mli | (*{{{ Copyright (c) 2014 Andy Ray <andy.ray@ujamjar.com>
* Copyright (c) 2012-2013 Anil Madhavapeddy <anil@recoil.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice app... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-lwt-jsoo/src/dune | (library
(name cohttp_lwt_jsoo)
(public_name cohttp-lwt-jsoo)
(synopsis "XHR/Lwt based http client")
(preprocess
(pps js_of_ocaml-ppx))
(libraries js_of_ocaml cohttp-lwt logs))
|
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | ml | cohttp-6.2.1/cohttp-lwt-jsoo/test/src/cohttp_lwt_jsoo_test.ml | module Client = Cohttp_lwt_jsoo.Client
module Js = Js_of_ocaml.Js
let _Promise = Js.Unsafe.global##._Promise
let ( let* ) = Lwt.( >>= )
let ( let+ ) = Lwt.( >|= )
let promise_of_lwt lwt =
new%js _Promise
(Js.wrap_callback (fun resolve reject ->
try%lwt
let+ res = lwt () in
Js.Unsa... |
cohttp-lwt | 6.2.1 | ISC | https://github.com/mirage/ocaml-cohttp | git+https://github.com/mirage/ocaml-cohttp.git | dune | cohttp-6.2.1/cohttp-lwt-jsoo/test/src/dune | (executable
(name cohttp_lwt_jsoo_test)
(modes js)
(libraries http cohttp cohttp-lwt cohttp-lwt-jsoo lwt js_of_ocaml-lwt)
(preprocess
(pps lwt_ppx js_of_ocaml-ppx)))
(rule
(alias runjstest)
(deps test.js cohttp_lwt_jsoo_test.bc.js)
(action
(setenv
NODE_PATH
"%{project_root}/cohttp-lwt-jsoo/test/node_m... |
End of preview. Expand in Data Studio
This is a dataset automatically generated from ocaml/opam:archive. You can find more information about this dataset in this blogpost.
- Downloads last month
- 727