Open sbernard31 opened 3 weeks ago
Another alternative is to use the HTTP server in the JDK: https://docs.oracle.com/en/java/javase/11/docs/api/jdk.httpserver/com/sun/net/httpserver/HttpServer.html It's here since forever (1.6?) in the com.sun.* namespace but since https://openjdk.org/jeps/408 in java 18 it's pretty sure it will not go away
@jvermillard thx for sharing this !
I think if we can remove a useless dependencies this is a good thing. Do you know if there is any support of Server Sent Event ? (I will not be surprised if there was no support of it)
never tried: https://stackoverflow.com/questions/67915286/java-sse-server-with-com-sun-net-httpserver-httpserver another option is long polling which should work for sure
I take a look at HttpServer
there is nothing to serve static resources in java8.
They add something like that with java18.
Of course we could implement our own HttpHandler
which do that but if we need to re-code everything(static resource, SSE, ...) not sure this is a good move. (Especially from a security point of view)
Too bad, I liked this idea to use JDK directly :disappointed:
As I didn't find any good solution... I currently consider to migrate to jetty 12 and so have different minimum java constraint. (not sure how this will affect the build, theoretically not so much as we didn't have any tests based on jetty)
This is not ideal but I'm afraid that it will be hard to keep to java8 for all leshan module anyway because more and more libraries move to java 11 or 17... I mean I will not surprised if in the future java minimal version is not the same for each transport layer implementation... :disappointed:
I try to fight against the idea at the back of my mind, that maybe using HttpServer from JDK and write support of SSE and static resource on my own is not so much of code. :sweat_smile:
A try to move to jetty 12 : #1667
source :
The only supported one will be v12 which use 17 as minimum version ...
So either :
( When we will remove jetty 9.x dependencies, we should remove corresponding CVE in
.trivyignore
)