RFR: 8368695: Support 101 switching protocol in jdk.httpserver

Mahied Maruf duke at openjdk.org
Wed Nov 5 14:30:52 UTC 2025


On Sat, 25 Oct 2025 16:02:05 GMT, Josiah Noel <duke at openjdk.org> wrote:

> Remaking the PR since I messed up the upstream merge on the other one.
> 
> - adds a flag to ExchangeImpl to signal whether the current request is a GET Upgrade request
> - Adds a new `UpgradeInputStream`/`UpgradeOutputStream` to ensure that the server keeps track of when the upgraded request is closed
> - on 101 response codes, `sendResponseHeaders` will not immediately close the output stream 
> - on 101 response codes, `sendResponseHeaders` will use an `UpgradeInputStream`

LGTM — I need this patch for websocket support.

-------------

PR Review: https://git.openjdk.org/jdk/pull/27989#pullrequestreview-3422385900


More information about the net-dev mailing list