pedestal 2026-10-05

Hello I developed a new pedestal connector around https://docs.oracle.com/en/java/javase/27/docs/api/jdk.httpserver/module-summary.html This allows you to spin up pedestal without external HTTP servers, like jetty or http-kit. It is useful for beginners and local development. For real-world scenarios, jetty/http-kit are still recommended. I’d like to know if the community finds this useful as well. There are still a few things to be done on the PR, such as adding support for Clojure 1.11 (to pass the tests). If there is interest, I can finish the PR. https://github.com/pedestal/pedestal/pull/903

@hlship can you help reviewing this as you have more context than me on this?

This is good, it's something I've considered doing myself. I haven't looked at the PR yet, but if it doesn't implement SSE and WebSockets, then we'll need to think about having different tiers of network connectors (basic, w/ sse, w/ websockets). The Jetty and the HttpKit network connectors are fully featured. We may also want to find a way to pass each network connector through a uniform set of tests for conformance.

šŸ‘ 1

It may be a bit before I can review this PR.

šŸ‘ 1

A small wrinkle with the jdk.httpserver api that you should be aware of: When there is no response body to send, the value to pass to sendResponseHeaders is -1. When you don't yet know the length of the response to send, the value to pass is 0

so right now you have

(some-> response-headers
        (.getFirst "content-length")
        (parse-long))
You should do a "if this equals 0, return -1 " technically

šŸ‘ 2

@emccue good catch. Fixed.

this api is basically my special interest. I think it needs a very minor set of tweaks and then its actually usable

but getting stuff into the JDK is rough

I also added https support and "context path" šŸ™‚

@emccue Taking advantage of your knowledge on it, could you review the remote-addr (some-> http-exchange ... implementation? I'm not sure it it actually returns the "right" remote-addr.

heres everything i've done with it so far

its kinda circular because i took a lot of inspiration from ring and pedestal for making these libs

I do not remember if headers are case insensitive or not - i think they aren't (and if so you are good to go) but that is definitely something to unit test. Also remember that this API is an SPI. You can have the backing server be Jetty if you want, and there are differences between the JDK's impl (which is doo doo) and those.

For instance, last i checked context is entirely broken in the JDK's impl

just totally borked

because its keyed per >instance of the server< not per >request<

you are adding a lot with this PR that doesn't feel related to the JDK httpserver though

(extend-protocol ResponseMime
So idk how to evaluate it holistically

remote-addr (some-> http-exchange
                                .getRemoteAddress
                                .getAddress
                                .getHostAddress)
And yeah...idk about this either

i just genuinely don't remember