You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/11/08 21:56:25 UTC

[GitHub] [druid] techdocsmith commented on a change in pull request #11891: Support routing data through an HTTP proxy

techdocsmith commented on a change in pull request #11891:
URL: https://github.com/apache/druid/pull/11891#discussion_r745120013



##########
File path: docs/development/modules.md
##########
@@ -356,6 +356,24 @@ druid.coordinator.cleanupMetadata.duty.killSupervisors.retainDuration=PT0M
 druid.coordinator.cleanupMetadata.period=PT10S
 ```
 
+### Routing data through a HTTP proxy for your extension
+
+It is possible to adds the ability for the HttpClient of your extension to connect through a HTTP proxy. 
+Internally, Druid will augment the channel factory to check if it is supposed to be proxied and, if so, connect to the proxy host first, 
+issue a CONNECT command through to the final recipient host and then give the channel to the normal http client for usage.

Review comment:
       ```suggestion
   You can add the ability for the `HttpClient` of your extension to connect through an HTTP proxy. 
   Internally, Druid augments the channel factory to check if it should proxy connections. If so the client connects to the proxy host first to issue a subsequent `CONNECT` command through to the final recipient host. After the connection is established, the channel passes back to the original HTTP client for usage.
   ```
   I'm not sure what "normal" means in the connection here. It seems like the way that Druid handles it by passing the channel back and forth may be an implementation detail. I am wondering if I am enabling proxying why I need to know that? 

##########
File path: docs/development/modules.md
##########
@@ -356,6 +356,24 @@ druid.coordinator.cleanupMetadata.duty.killSupervisors.retainDuration=PT0M
 druid.coordinator.cleanupMetadata.period=PT10S
 ```
 
+### Routing data through a HTTP proxy for your extension
+
+It is possible to adds the ability for the HttpClient of your extension to connect through a HTTP proxy. 
+Internally, Druid will augment the channel factory to check if it is supposed to be proxied and, if so, connect to the proxy host first, 
+issue a CONNECT command through to the final recipient host and then give the channel to the normal http client for usage.
+
+To enable this feature and allow for proxy in your extension's HTTP client, 
+first, add `HttpClientProxyConfig` as a `@JsonProperty` to the HTTP config class of your extension. 
+Next, in the extension's module class, add `HttpProxyConfig` to `HttpClientConfig`. For example, 

Review comment:
       ```suggestion
   To enable proxy connection for your extension's HTTP client:
   1.  Add `HttpClientProxyConfig` as a `@JsonProperty` to the HTTP config class of your extension. 
   2. In the extension's module class, add `HttpProxyConfig` to `HttpClientConfig`. For example, where `HttpClientConfig` is the HTTP config class for your extension:
   ```
   (Not sure if I interpreted this correctly, but include the information from the note on line 375 in the for example statement here)

##########
File path: docs/development/modules.md
##########
@@ -356,6 +356,24 @@ druid.coordinator.cleanupMetadata.duty.killSupervisors.retainDuration=PT0M
 druid.coordinator.cleanupMetadata.period=PT10S
 ```
 
+### Routing data through a HTTP proxy for your extension
+
+It is possible to adds the ability for the HttpClient of your extension to connect through a HTTP proxy. 
+Internally, Druid will augment the channel factory to check if it is supposed to be proxied and, if so, connect to the proxy host first, 
+issue a CONNECT command through to the final recipient host and then give the channel to the normal http client for usage.
+
+To enable this feature and allow for proxy in your extension's HTTP client, 
+first, add `HttpClientProxyConfig` as a `@JsonProperty` to the HTTP config class of your extension. 
+Next, in the extension's module class, add `HttpProxyConfig` to `HttpClientConfig`. For example, 
+```
+final HttpClientConfig.Builder builder = HttpClientConfig
+    .builder()
+    .withNumConnections(1)
+    .withReadTimeout(config.getReadTimeout().toStandardDuration())
+    .withHttpProxyConfig(config.getProxyConfig());
+```
+(note that the `config` variable in the example above is the HTTP config class of your extension)

Review comment:
       ```suggestion
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org