{"id":21293110,"url":"https://github.com/criteo/lolhttp","last_synced_at":"2025-10-26T05:30:22.628Z","repository":{"id":20367112,"uuid":"89678147","full_name":"criteo/lolhttp","owner":"criteo","description":"An HTTP Server and Client library for Scala.","archived":false,"fork":false,"pushed_at":"2024-08-12T13:05:29.000Z","size":1767,"stargazers_count":91,"open_issues_count":30,"forks_count":19,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-02-03T20:33:23.659Z","etag":null,"topics":["http","http2","https","scala","web"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/criteo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-28T07:06:53.000Z","updated_at":"2024-03-17T23:00:13.000Z","dependencies_parsed_at":"2025-01-20T05:37:10.946Z","dependency_job_id":null,"html_url":"https://github.com/criteo/lolhttp","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criteo%2Flolhttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criteo%2Flolhttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criteo%2Flolhttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criteo%2Flolhttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/criteo","download_url":"https://codeload.github.com/criteo/lolhttp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238264672,"owners_count":19443388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["http","http2","https","scala","web"],"created_at":"2024-11-21T13:53:19.954Z","updated_at":"2025-10-26T05:30:22.241Z","avatar_url":"https://github.com/criteo.png","language":"Scala","readme":"\u003cimg src=\"https://criteo.github.io/lolhttp/images/lolhttp.png\" width=\"70\"\u003e\n\n# lolhttp\n\nAn HTTP Server and Client library for Scala.\n\n## About the library\n\nA server is built from a plain function accepting an HTTP request and eventually giving back an HTTP response. The computation is wrapped into an [effect](https://github.com/typelevel/cats-effect) and can handle pure \u0026 impure and synchronous \u0026 asynchronous scenarios. Requests and responses are just HTTP metadata along with a lazy content body based on [fs2](https://github.com/functional-streams-for-scala/fs2), making it easy to handle streaming scenarios if needed. For additional convenience, the library provides content encoders and decoders for the common scala types. Clients and Servers share the same API and the same concepts, making it easy to compose them. __SSL__ is supported on both sides.\n\n## Hello World\n\n```scala\n// Let's start an HTTP server\nServer.listen(8888) {\n  case GET at \"/hello\" =\u003e\n    Ok(\"Hello World!\")\n  case _ =\u003e\n    NotFound\n}\n\n// Let's connect with an HTTP client\nClient.runSync(Get(\"http://localhost:8888/hello\")) { res =\u003e\n  res.readAs[String].map { contentBody =\u003e\n    println(s\"Received: $contentBody\")\n  }\n}\n```\n\n## Usage\n\nThe library is cross-built for __Scala 2.11__ and __Scala 2.12__.\n\nThe core module to use is `\"com.criteo.lolhttp\" %% \"lolhttp\" % \"0.13.1\"`.\n\nThere are also 2 optional companion libraries:\n\n- `\"com.criteo.lolhttp\" %% \"loljson\" % \"0.13.1\"`, provides integration with the [circe](https://circe.github.io/circe/) JSON library.\n- `\"com.criteo.lolhttp\" %% \"lolhtml\" % \"0.13.1\"`, provides minimal HTML templating.\n\n## Documentation\n\nThe [API documentation](https://criteo.github.io/lolhttp/api/lol/index.html) is the main reference.\n\nIf you never used [cats effects](https://github.com/typelevel/cats-effect) before, you should start by having a quick look at it. Service [Responses](https://criteo.github.io/lolhttp/api/lol/http/Response.html) must be wrapped\ninto an `IO` (although there is an implicit conversion translating `Response` into a pure `IO` if needed). Also consuming the underlying content stream data is an effect. For asynchronous scenarios you have to deal with asynchronous effects, unless you prefer working with `Future` and wrapping it at the end using `IO.fromFuture`.\n\nIf you need to access the underlying content stream, you should first have a look a the [fs2 documentation](https://github.com/functional-streams-for-scala/fs2) to understand the basics.\n\nFor those who prefer documentation by example, you can also follow these hands-on introductions:\n\n- [Hello world!](https://criteo.github.io/lolhttp/examples/HelloWorld.scala.html)\n- [Serving files from classpath](https://criteo.github.io/lolhttp/examples/ServingFiles.scala.html).\n- [A Github API client](https://criteo.github.io/lolhttp/examples/GithubClient.scala.html).\n- [A JSON web service](https://criteo.github.io/lolhttp/examples/JsonWebService.scala.html).\n- [Accessing an SQL Database](https://criteo.github.io/lolhttp/examples/DatabaseAccess.scala.html).\n- [Reading large request streams](https://criteo.github.io/lolhttp/examples/LargeFileUpload.scala.html).\n- [A simple reverse proxy](https://criteo.github.io/lolhttp/examples/ReverseProxy.scala.html).\n\n## License\n\nThis project is licensed under the Apache 2.0 license.\n\n## Copyright\n\nCopyright © Criteo, 2018.\n","funding_links":[],"categories":["Table of Contents","HTTP"],"sub_categories":["HTTP"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcriteo%2Flolhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcriteo%2Flolhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcriteo%2Flolhttp/lists"}