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

[client-v2] Proxy support #1748

Merged
merged 7 commits into from
Jul 29, 2024
Merged

[client-v2] Proxy support #1748

merged 7 commits into from
Jul 29, 2024

Conversation

chernser
Copy link
Contributor

@chernser chernser commented Jul 25, 2024

Summary

  • Added forwarding proxy configuration to new http layer
  • Added auth configuration for proxy
  • Added ability to disable storing cookies

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in /~https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

@chernser chernser marked this pull request as ready for review July 26, 2024 21:37
@chernser chernser requested review from Paultagoras and mzitnik July 26, 2024 21:38
@@ -444,6 +450,12 @@ public Builder useNewImplementation(boolean useNewImplementation) {
return this;
}

public Builder setHttpCookiesEnabled(boolean enabled) {
//TODO: extract to settings string constants
this.configuration.put("client.http.cookies_enabled", String.valueOf(enabled));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is that used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • sticky sessions
  • some enterprise proxies like F5 that store routing information in cookies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually there may be opposite case when cookies should not be preserved to avoid sticky session when proxy behavior may not be changed.

public HttpAPIClientHelper(Map<String, String> configuration) {
this.chConfiguration = configuration;
this.httpClient = createHttpClient(configuration, null);
this.httpClient = createHttpClient();
this.baseRequestConfig = RequestConfig.custom()
.setConnectionRequestTimeout(1000, TimeUnit.MILLISECONDS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be configurable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Added more configuration parameters. Planning to add more later.

@chernser chernser requested a review from mzitnik July 29, 2024 06:52
Copy link

@chernser chernser merged commit 97bd8a1 into main Jul 29, 2024
59 checks passed
@chernser chernser deleted the feat_proxy_support branch July 29, 2024 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants