Http4s Finagle


License

License

GroupId

GroupId

us.oyanglul
ArtifactId

ArtifactId

http4s-finagle_2.12
Last Version

Last Version

0.21.3-20.4.1-0
Release Date

Release Date

Type

Type

jar
Description

Description

Http4s Finagle
Http4s Finagle
Project URL

Project URL

https://github.com/jcouyang/http4s-finagle
Project Organization

Project Organization

us.oyanglul
Source Code Management

Source Code Management

https://github.com/jcouyang/http4s-finagle

Download http4s-finagle_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/us.oyanglul/http4s-finagle_2.12/ -->
<dependency>
    <groupId>us.oyanglul</groupId>
    <artifactId>http4s-finagle_2.12</artifactId>
    <version>0.21.3-20.4.1-0</version>
</dependency>
// https://jarcasting.com/artifacts/us.oyanglul/http4s-finagle_2.12/
implementation 'us.oyanglul:http4s-finagle_2.12:0.21.3-20.4.1-0'
// https://jarcasting.com/artifacts/us.oyanglul/http4s-finagle_2.12/
implementation ("us.oyanglul:http4s-finagle_2.12:0.21.3-20.4.1-0")
'us.oyanglul:http4s-finagle_2.12:jar:0.21.3-20.4.1-0'
<dependency org="us.oyanglul" name="http4s-finagle_2.12" rev="0.21.3-20.4.1-0">
  <artifact name="http4s-finagle_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='us.oyanglul', module='http4s-finagle_2.12', version='0.21.3-20.4.1-0')
)
libraryDependencies += "us.oyanglul" % "http4s-finagle_2.12" % "0.21.3-20.4.1-0"
[us.oyanglul/http4s-finagle_2.12 "0.21.3-20.4.1-0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.10
org.http4s : http4s-core_2.12 jar 0.21.3
org.http4s : http4s-client_2.12 jar 0.21.3
com.twitter : finagle-http_2.12 jar 20.4.1

test (3)

Group / Artifact Type Version
org.scalameta : munit_2.12 jar 0.7.5
org.scalameta : munit-scalacheck_2.12 jar 0.7.5
org.http4s : http4s-dsl_2.12 jar 0.21.3

Project Modules

There are no modules declared in this project.

Http4s Finagle

Build codecov
Cats Friendly Badge

if your http4s version is 0.21.x simply set http4s-finagle to 0.21+

libraryDependencies += "org.http4s" %% "http4s-finagle" % "0.21+"

if in any circumstance you need fix the finagle version(most cases not, finagle api is quite stable)

libraryDependencies += "org.http4s" %% "http4s-finagle" % "0.21.4-20.4.1-0"
                                                           ^      ^      ^
                                                      http4s   fingale   patch

Server

To run Http4s app on Finagle Http server, simply just use Finagle.mkService to adapt Http4s HttpApp[F] to Fingale Service[Request, Response].

import org.http4s.finagle._

val http4sService: HttpApp[IO] = ???

val server = Http.server.serve(":8080", Finagle.mkService(http4sService))
Await.ready(server)

Client

import org.http4s.finagle._
import com.twitter.finagle.Http

val host = "blog.oyanglul.us"
Finagle.mkClient[IO](Http.client.withTls(host).newService(s"$host:443")).use {
  client: Client[IO] =>
  ...
}

Please refer to the Test which is fully functional server and client.

Versions

Version
0.21.3-20.4.1-0
0.21.1