Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 18 15:35
    nachocodexx starred Spinoco/fs2-http
  • Oct 04 01:36
    AesaKamar starred Spinoco/fs2-http
  • Jul 28 13:21
    pmukhin commented #44
  • Jun 25 07:21
    bellatoris starred Spinoco/fs2-http
  • May 11 14:59
    mfirry commented #43
  • May 05 18:37
    FXHibon starred Spinoco/fs2-http
  • May 03 08:19
    AdamChlupacek synchronize #44
  • May 03 08:19

    AdamChlupacek on upgrade-to-fs2.3

    Address review comments, remove… (compare)

  • May 02 18:40
    AdamChlupacek synchronize #44
  • May 02 18:40

    AdamChlupacek on upgrade-to-fs2.3

    Fix travis dependencies. (compare)

  • May 02 18:35

    AdamChlupacek on 0.5

    Fix travis dependencies. (compare)

  • May 02 18:33
    AdamChlupacek review_requested #44
  • May 02 18:33
    AdamChlupacek review_requested #44
  • May 02 18:33
    AdamChlupacek opened #44
  • May 02 18:27

    AdamChlupacek on upgrade-to-fs2.3

    Setting version to 0.4.0-SNAPSH… Updated to fs2 1.0.0 final Fixes #29 and 16 more (compare)

  • May 02 18:14

    AdamChlupacek on 0.5

    Merge branch 'series/0.4' of gi… (compare)

  • May 02 18:09

    AdamChlupacek on upgrade-to-fs2.3

    Migrate fs2-http to fs2 2.3.0 +… (compare)

  • Apr 23 07:28
    nebtrx starred Spinoco/fs2-http
  • Apr 10 12:43
    mfirry opened #43
  • Apr 10 12:31
Soren
@srnb_gitlab
image.png
Adam Chlupacek
@AdamChlupacek
Hmm interesting, maybe i misslooked when checking, how it is being serialised. Since your header is not following the RFC, you may have to define your own header, but i find it weird that discord would require non standard headers
Soren
@srnb_gitlab
@AdamChlupacek I can't define my own header because it's a sealed trait
Adam Chlupacek
@AdamChlupacek
you can override the default serialisation of the authorisation header as shown in the example
Soren
@srnb_gitlab
GenericHeader seems to have done it
Adam Chlupacek
@AdamChlupacek
Good, that is a good quick fix if you are only needing client side of things to work.
Soren
@srnb_gitlab
java.lang.ClassCastException: spinoco.protocol.http.header.GenericHeader cannot be cast to spinoco.protocol.http.header.Authorization
    at scodec.Codec$$anon$2.encode(Codec.scala:200)
    at scodec.Codec$$anon$7.encode(Codec.scala:400)
    at scodec.EncoderFunctions.$anonfun$encodeBoth$1(Encoder.scala:111)
    at scodec.Attempt$Successful.flatMap(Attempt.scala:94)
    at scodec.EncoderFunctions.encodeBoth(Encoder.scala:110)
    at scodec.EncoderFunctions.encodeBoth$(Encoder.scala:109)
    at scodec.Codec$.encodeBoth(Codec.scala:460)
    at scodec.codecs.TupleCodec.encode(TupleCodec.scala:12)
    at scodec.codecs.TupleCodec.encode(TupleCodec.scala:6)
    at scodec.Codec$$anon$2.encode(Codec.scala:200)
    at scodec.EncoderFunctions.$anonfun$encodeBoth$1(Encoder.scala:111)
    at scodec.Attempt$Successful.flatMap(Attempt.scala:94)
    at scodec.EncoderFunctions.encodeBoth(Encoder.scala:110)
    at scodec.EncoderFunctions.encodeBoth$(Encoder.scala:109)
    at scodec.Codec$.encodeBoth(Codec.scala:460)
    at scodec.Codec$$anon$3.encode(Codec.scala:303)
    at scodec.Codec$$anon$3.encode(Codec.scala:301)
    at scodec.Codec$$anon$2.encode(Codec.scala:200)
    at scodec.Codec$$anon$7.encode(Codec.scala:400)
    at spinoco.protocol.http.codec.helper$.go$2(helper.scala:162)
    at spinoco.protocol.http.codec.helper$.$anonfun$parametrizedN$1(helper.scala:168)
    at scodec.Attempt$Successful.flatMap(Attempt.scala:94)
GenericHeader did not do it
Adam Chlupacek
@AdamChlupacek
Oh yeah, actually that is right, as "Authorization" header is registered as one of the known headers, it will try to encode it as such. You need to define your own header, and create your own HttpHeader codec using the HttpHeaderCodec.codec, so that you can actually override the default coded for the header.
Soren
@srnb_gitlab
:weary: case class TokenHeader(token: String) should work right
Adam Chlupacek
@AdamChlupacek
Yeah, that should be fine, if you follow the docs
You can actually just use the generic, if you set that authorisation gets a codec for a generic header it is one of the exaplmes in the doc
Soren
@srnb_gitlab
Yeah, everything is working now
Adam Chlupacek
@AdamChlupacek
Good, thats great
Sait Sami Kocataş
@Deliganli

hi everyone,

I am trying to transform the stream response to an effect response like below

httpClient.request(request).compile.lastOrError

I am trying to keep the http responses as effect if possible. I want to use fs2-http for websocket as well, that's why even though in some places i need to lift it to stream it makes more sense to me to keep it as effect first. But when I do that I am having the exception below on any http request.

 java.nio.channels.ClosedChannelException: null                                                              
         at java.base/sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:234)  
         at java.base/sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:298)  
         at fs2.io.tcp.Socket$.$anonfun$apply$3(Socket.scala:283)                                            
         at fs2.io.tcp.Socket$.$anonfun$apply$3$adapted(Socket.scala:276)

maybe it is not intended to evaluate that way, is it possible to use this way?

Soren
@srnb_gitlab
That's FS2-IO's socket
I have that same problem with FS2's sockets
You want to ask here
Sait Sami Kocataş
@Deliganli
thanks, I am moving it now
Seth Lasky
@TheMover
Hey guys, how can I send an SSL cert along with a request?
Seth Lasky
@TheMover
Also(sorry for rapid fire questions) is there a good way to post multipart data?
Seth Lasky
@TheMover
Figured out the ssl context, now it's only one question
Adam Chlupacek
@AdamChlupacek
Hello @TheMover , sadly currently we do not have any support for multipart data. I have some preliminary support in one of my project, I could polish it over the weekend and get it into snapshot.
Seth Lasky
@TheMover
That would be sweet, could I take a look at it?
Adam Chlupacek
@AdamChlupacek
@TheMover Its not public, its in our production, we wanted to test it there before we put it into fs2-http, but it is similar how we have multipart done for email (https://github.com/Spinoco/fs2-mail/blob/series/0.4/src/main/scala/spinoco/fs2/mail/mime/MIMEPart.scala)
Sait Sami Kocataş
@Deliganli

I was checking client side web sockets. I can see there is a parameter for pinging in server function but it is not exposed in client side

WebSocket:112

case None => (body through impl.webSocketOf(pipe, Duration.Undefined, maxFrameSize, client2Server = true) through socket.writes(None)).drain ++ emit(None)

Is there a way I am missing?

Adam Chlupacek
@AdamChlupacek
@Deliganli This seems to be an oversight. I think there is no reason why client should not allow to send ping.
Adam Chlupacek
@AdamChlupacek
@TheMover Hey there, I have not managed to get the whole thing ported yet, but there is now PR into protocols which is required to enable to port the multipart support over to the fs2-http. So progress is there but slow :/
Soren
@srnb_gitlab
What's blocking fs2-http from 2.13 at the moment?
Adam Chlupacek
@AdamChlupacek
Hey @srnb_gitlab we are waiting for protocols to get their 2.13 version, they are however blocked on kafka, which should get 2.13 build in the 2.4.0 release, until then we are stuck :/
Soren
@srnb_gitlab
@AdamChlupacek Any chance you can hack a 2.13 build of protocols-http out? (Add a crossScalaVersions += "2.13.0" to it and publish?)
Adam Chlupacek
@AdamChlupacek
@srnb_gitlab I can try have a look at it over the weekend, but i guess snapshot will be the best we can hope for at the moment
Soren
@srnb_gitlab
:ok_hand:
I'll ask in scala/scala because I might be able to publishLocal it for 2.13
I'll send you what I've done if it works
Soren
@srnb_gitlab
@AdamChlupacek You should be able to add crossScalaVersions += "2.13.0" to the http module's .settings( and then sbt ++2.13.0 http/publish?
Adam Chlupacek
@AdamChlupacek
@srnb_gitlab I will try to get this together tomorrow, thank you for the how to
Soren
@srnb_gitlab
:+1:
Luciano
@lJoublanc
Hey guys fs2-http doesn't have support for HTTP/2, does it?
Adam Chlupacek
@AdamChlupacek
Yeah it currently does not
Adam Chlupacek
@AdamChlupacek
@srnb_gitlab I have tried it, and sadly it seems its not currently that straight forward, we are using some flags which seem not to be supported in 2.13 anymore. We already have a contributor in protocols trying to get it working for 2.13, I will ask him to make sure that everything other than kafka is working and at that point I will make a snapshot from the branch.
Soren
@srnb_gitlab
Alright
@lJoublanc I've been learning about HTTP/2 and QUIC and I kinda want to make a contribution to fs2-http with them
Adam Chlupacek
@AdamChlupacek
With http/2 there could be major issue with java8 i have been looking into it in the past, and basically the sslEngine provided by java does not support application protocol extension, which is one of the main ways how connection gets into http/2 :/
Luciano
@lJoublanc
My personal interest is from google protocolbuffers/gRPC . Just messing around with that and it uses HTTP/2 for transport.
@AdamChlupacek I see htt4s has support - I wonder how they manage it without the JVM version restriction.
Soren
@srnb_gitlab
http4s runs through fs2-io sockets to do HTTP as far as I know @lJoublanc
Adam Chlupacek
@AdamChlupacek
As far as I know there is a path that basically overrides the default classes so that it supports this feature
Do not take me 100% on this here, but basically, if you have your own SSL stack then you can do what ever, we however are using the fs2-crypto, which for the ease of things is using the java SSLEngine to provide SSL/TLS, which in java 8 sadly does not support the extension. To which, as I mentioned, I saw somewhere some patches to get the extension support there, but to me it is a bit weird to override the default classes, it makes a mess of the dependencies.