r/java • u/revetkn27 • Jan 20 '26
Soklet: a zero-dependency HTTP/1.1 and SSE server, powered by virtual threads
Hi, I built the first version of Soklet back in 2015 as a way to move away from what I saw as the complexity and "magic" of Spring (it had become the J2EE creature it sought to replace). I have been refining it over the years and have recently released version 2.0.0, which embraces modern Java development practices.
Check it out here: https://www.soklet.com
I was looking for something that captured the spirit of projects like Express (Node), Flask (Python), and Sinatra (Ruby) but had the power of a "real" framework and nothing else quite fit: Spark/Javalin are too bare-bones, Quarkus/Micronaut/Helidon/Spring Boot/etc. have lots of dependencies, moving parts, and/or programming styles I don't particularly like (e.g. reactive).
What I wanted to do was make building a web system almost as easy as a "hello world" app without compromising functionality or adding dependencies and I feel I have accomplished this goal.
Other goals - support for Server-Sent Events, which are table-stakes now in 2026 and "native" integration testing (just run instances of your app in a Simulator) are best-in-class in my opinion. Servlet integration is also available if you can't yet fully disentangle yourself from that world.
If you're interested in Soklet, you might like some of its zero-dependency sister projects:
Pyranid, a modern JDBC interface that embraces SQL: https://www.pyranid.com
Lokalized, which enables natural-sounding translations (i18n) via an expression language: https://www.lokalized.com
I think Java is going to become a bigger player in the LLM space (obviously virtual threads now, forthcoming Vector API/Project Panama/etc.) If you're building agentic systems (or just need a simple REST API), Soklet might be a good fit for you.
5
u/Moercy Jan 21 '26
I like to see the jdbc implementation, as I am a big fan of Dapper from the .NET world.
Do you have any examples on how you bind JOINs?
2
u/msx Jan 20 '26
This looks pretty awesome. I share your thoughts on spring and those super frameworks. I was looking into some small http server just the other day.
How stable/field tested is it?
2
u/chabala Jan 21 '26
While I don't have a need for it, it's nice to see such a high quality project posted. From all three of them, it's clear you know what you're doing.
2
u/Isaac_Istomin Jan 22 '26
Soklet actually looks close to what I usually want: small like Express/Flask, but still “real Java” and using virtual threads instead of forcing reactive everywhere. What I’d be most curious about for real-world use is: how easy it is to plug in structured logging/metrics/tracing, how it behaves with lots of long-lived SSE connections, and what the graceful shutdown story is (draining requests/SSE cleanly). That’s usually the point where frameworks start to feel either really nice or painful.
2
u/robintegg Feb 08 '26
Excited to check it out and those other dependencies you mentioned. Great to see some different approaches being actively developed
1
u/gripepe Jan 20 '26
Aside, do you have any about SSEs becoming more widespread lately?
I think I started playing with them back in 2019 but by then it was a pretty unknown HTTP API. Are they better supported now?
1
u/bigkahuna1uk Jan 20 '26
How does marshalling work? In your examples I see a date or a Locale transformed it seems automatically into the equivalent Java object such as LocalDate or Locale respectively. Does this use a JSON library like Jackson for marshalling?
I ask because the documentation says there are zero dependencies so are all the marshalling intrinsic to your library? I’m intrigued how this works from a REST perspective.
Thanks in advance.
1
u/OwnBreakfast1114 Jan 20 '26
Is the expectation for things like authentication that it will be implemented via custom RequestInterceptors?
1
u/Necessary_Smoke4450 Jan 22 '26
Vert.x probably a good choice
1
u/NHarmonia18 Mar 04 '26
Helidon 4+ has been re-written from the ground up (socket-level) to be COMPLETELY Virtual Threads based, and one of its CORE GOALS is to have minimum third-party dependencies. The philosophy they very strictly follow by keeping the default Logger to be based on System.Logger / java.util.Logging. Not to mention Helidon is maintained by Oracle so the devs have the privilege of working with core JDK team.
If you want light and minimalistic framework while also having the flexibility of easy integration with industry-standard technologies (MicroProfile), Helidon is a better fit I argue, You can start with plain Jakarta REST and scale up to full MicroProfile, all while having a Virtual-Threads based core.
2
u/revilo-1988 Jan 20 '26
They look very interesting, good work!