All Projects → criteo → lolhttp

criteo / lolhttp

Licence: Apache-2.0 license
An HTTP Server and Client library for Scala.

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to lolhttp

Http2 Wrapper
Use HTTP2 the same way like HTTP1
Stars: ✭ 183 (+96.77%)
Mutual labels:  https, http2
RB-libcURL
A Realbasic and Xojo binding to libcurl
Stars: ✭ 19 (-79.57%)
Mutual labels:  https, http2
Httpcanary
A powerful capture and injection tool for the Android platform
Stars: ✭ 2,188 (+2252.69%)
Mutual labels:  https, http2
Awesome Http Benchmark
HTTP(S) benchmark tools, testing/debugging, & restAPI (RESTful)
Stars: ✭ 2,236 (+2304.3%)
Mutual labels:  https, http2
libmicrohttpd-http2
HTTP/2 support for libmicrohttpd
Stars: ✭ 21 (-77.42%)
Mutual labels:  https, http2
Nginxconfig.io
⚙️ NGINX config generator on steroids 💉
Stars: ✭ 14,983 (+16010.75%)
Mutual labels:  https, http2
Aws S3 Proxy
Reverse proxy for AWS S3 with basic authentication.
Stars: ✭ 227 (+144.09%)
Mutual labels:  https, http2
Armor
Uncomplicated, modern HTTP server
Stars: ✭ 1,629 (+1651.61%)
Mutual labels:  https, http2
cryptonice
CryptoNice is both a command line tool and library which provides the ability to scan and report on the configuration of SSL/TLS for your internet or internal facing web services. Built using the sslyze API and ssl, http-client and dns libraries, cryptonice collects data on a given domain and performs a series of tests to check TLS configuration…
Stars: ✭ 91 (-2.15%)
Mutual labels:  https, http2
tipi
Tipi - the All-in-one Web Server for Ruby Apps
Stars: ✭ 214 (+130.11%)
Mutual labels:  https, http2
Siris
DEPRECATED: The community driven fork of Iris. The fastest web framework for Golang!
Stars: ✭ 146 (+56.99%)
Mutual labels:  https, http2
3dub
www dev server with livereload, file watching, http2, https, self signed cert generation
Stars: ✭ 28 (-69.89%)
Mutual labels:  https, http2
Nuster
A high performance HTTP proxy cache server and RESTful NoSQL cache server based on HAProxy
Stars: ✭ 1,825 (+1862.37%)
Mutual labels:  https, http2
Haproxy
HAProxy Load Balancer's development branch (mirror of git.haproxy.org)
Stars: ✭ 2,463 (+2548.39%)
Mutual labels:  https, http2
Httpserver
Http server is written on C++14 language. Dynamic libraries act as applications for the server (*.so - linux, *.dll - windows).
Stars: ✭ 141 (+51.61%)
Mutual labels:  https, http2
Tcpprobe
Modern TCP tool and service for network performance observability.
Stars: ✭ 207 (+122.58%)
Mutual labels:  https, http2
Https Localhost
HTTPS server running on localhost
Stars: ✭ 122 (+31.18%)
Mutual labels:  https, http2
Ymhttp
基于 libcurl 的 IO 多路复用 HTTP 框架,适用于 iOS 平台,支持 HTTP/HTTPS/HTTP2/DNS(SNI)
Stars: ✭ 127 (+36.56%)
Mutual labels:  https, http2
esa-httpclient
An asynchronous event-driven HTTP client based on netty.
Stars: ✭ 82 (-11.83%)
Mutual labels:  https, http2
Ghost-over-Caddy
This repo/script will install Ghost blog over Caddy web server as a reverse proxy.
Stars: ✭ 20 (-78.49%)
Mutual labels:  https, http2

lolhttp

An HTTP Server and Client library for Scala.

About the library

A 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 and can handle pure & impure and synchronous & asynchronous scenarios. Requests and responses are just HTTP metadata along with a lazy content body based on 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.

Hello World

// Let's start an HTTP server
Server.listen(8888) {
  case GET at "/hello" =>
    Ok("Hello World!")
  case _ =>
    NotFound
}

// Let's connect with an HTTP client
Client.runSync(Get("http://localhost:8888/hello")) { res =>
  res.readAs[String].map { contentBody =>
    println(s"Received: $contentBody")
  }
}

Usage

The library is cross-built for Scala 2.11 and Scala 2.12.

The core module to use is "com.criteo.lolhttp" %% "lolhttp" % "0.13.1".

There are also 2 optional companion libraries:

  • "com.criteo.lolhttp" %% "loljson" % "0.13.1", provides integration with the circe JSON library.
  • "com.criteo.lolhttp" %% "lolhtml" % "0.13.1", provides minimal HTML templating.

Documentation

The API documentation is the main reference.

If you never used cats effects before, you should start by having a quick look at it. Service Responses must be wrapped into 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.

If you need to access the underlying content stream, you should first have a look a the fs2 documentation to understand the basics.

For those who prefer documentation by example, you can also follow these hands-on introductions:

License

This project is licensed under the Apache 2.0 license.

Copyright

Copyright © Criteo, 2018.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].