kordlib/kord

Switch to another HttpEngine

DRSchlaubi opened this issue · 6 comments

Currently, we're using the CIO. This gave us the follwing features:

  • Support for WebSockets (it was the only engine supporting WebSockets at the time)
  • It supports native

However, it is very experimental and only supports HTTP/1

Alternative Engines

OkHttp

  • Supports WebSockets
  • Supports HTTP/2
  • Extra dependency on OkHttp

Java 11 HTTP Client

  • Supports Websockets
  • Supports HTTP/2
  • No additional dependency
  • Requires JDK 11

Alternatives

Don't bundle an Engine at all and let the user choose

I don't have any strong opinions on this.

But I'm also not aware of any real issues with CIO, does Discord even support HTTP/2?

And I also don't think we should upgrade to JDK 11 (and force users to do so too) just because of the engine available there. If a Kord user really wants to use it, they can just override the default client provided by Kord.

I think it is in order to support MPP depending on the second point
We already support changing the HttpClient as of now which is not an issue as of the time being. but I do see that later when Kord becomes MPP

But I'm also not aware of any real issues with CIO, does Discord even support HTTP/2?

Everything get's proxied through cloudflare so they should

I think it is in order to support MPP depending on the second point
We already support changing the HttpClient as of now which is not an issue as of the time being. but I do see that later when Kord becomes MPP

We would need multiple multiple engines for MPP anyways as CIO doesn't support js anyways

We can use this pattern when switching to multiplatform.

Discord even supports HTTP/3, so to be future-proof I think we should switch to OkHttp, since they tend to work on those protocols support and have a more flexible release cycle than the java client

JVM now is the only platform not supporting it (cuz CIO)

sure, i don't have any objections