Skip to content

Use websocket over varying http protocols using a single client #12659

Closed

Description

@iiliev2

Jetty 12

Currently when upgrading to a websocket, the http version over which it will happen is determined by the capabilities of the underlying http client. This means that there must me one instance setup for each, if we want to specify the version on a per-request basis. In order to be able to use a single instance of the http client, the websocket client code should provide a way to specify in the upgrade request which http version to be used.

ClientUpgradeRequest upgradeRequest = ...
upgradeRequest.setHttpVersion(version);
webClient.connect(endpoint, upgradeRequest, null);

Example use case: a transparent jetty proxy, using one http and websocket client, which is setting the http version of the upgrade to the target to be the same as between it and the source. The proxy uses secured transports, similar to the examples in org.eclipse.jetty.proxy.ClientAuthProxyTest(ie it has the proper ssl certificates and knows how to talk to the target on behalf of the source).

Activity

  1. added 2 commits that reference this issue on May 28, 2025
  2. added a commit that references this issue on Jun 10, 2025
  3. lachlan-roberts commented on Jun 10, 2025

    @lachlan-roberts
    Member

    This feature has been added in the 12.1.x branch and will be released with 12.1.0.

  4. moved this from 🏗 In progress to ✅ Done in Jetty 12.1.0 - (FROZEN)on Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions