Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
iiliev2 opened this issue Dec 20, 2024 · 0 comments
Open

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

iiliev2 opened this issue Dec 20, 2024 · 0 comments

Comments

@iiliev2
Copy link

iiliev2 commented Dec 20, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant