Closed nandagopalan closed 6 months ago
Hi @neo7337 @nandagopalan I would like to implement this.
Can you please guide me with the following doubts:
UseEnvProxy
function?https
do we need to set the TLSConfig in the SetProxy
function?Let me know if I am missing something here.
Thank you!!
Hi @rajkumarGosavi, Thank you for your interest. I have assigned this issue to you. The idea is to just ensure that there are options for using different proxies for http and https. And each may have a different credentials too. ( we will stick to basic auth here)
Upon revisiting the code , This appears to be a complete revamp of the proxy setting in the library. At the moment the code here appears to be incorrect as its using the builtin ProxyURL returns a proxy function (for use in a Transport) that always returns the same URL. as per the documentation. This hasn't been tested out.
As a part of this issue we need to.
1) Update Client Struct to hold config for both http and https proxy details along with credentials for them (currently one one credential supported allow both of them to be used). This can be done by leveraging the Builtin Proxy Config and renaming the current proxy credential to httpProxyCredential and httpsProxyCredential respectively. The config member of the client will be defaulted to Environment configuration.
When the Transport is initialised, set the value to the c.config.ProxyFunc() ( refer to doco here )
Add the protocol as as enum variadic parameter to with enum type ( Http and Https) to the following signature
The above 2 functions will update the client#Config struct with appropriate values, set credentials per type as well as update the httpClient.Transport#Proxy to a new function by invoking client.proxyConfig#ProxyFunc()
Closing this issue.
The rest.Client#UseEnvProxy currently does not specify if the proxy is for HTTP or HTTPs update the function to include the protocol as well.