Basic http proxy configuration support by marcuslinke · Pull Request #386 · docker-java/docker-java
Fix issue #384. Respects the following system variables and their https counterparts:
http.proxyHost
http.proxyPort
http.nonProxyHosts
http.proxyUser
http.proxyPassword
Not sure but seems there is no other way to set Proxy? Is it possible to make additional withProxy() for client Builder? Use case: in jenkins Proxy configuratin is handled from UI and contains in jenkins objects, so plugins must pick jenkins proxy for connections.
@KostyaSha I think this could be implemented in a separate PR later. Need to evaluate proxy support for future netty engine first to define a common API. This is just 'basic' support of http proxies variables.
@KostyaSha OK, I agree. Lets merge this to 2.x so basic proxy support will do it in v2.1.3 which i will release then. What should be included in v3.0.0? I think we should provide basic v1.21 API version compatibility at least. Existing tests should run against it succesfully.
marcuslinke added a commit that referenced this pull request
Dec 8, 2015This breaks if you pass unix:///var/run/docker.sock and have the proxies set. Could you check for uri type unix and not use a proxy in this case as it makes no sense?
I'm confused as to why should it trow an exception? You saying that if http_proxy is set you cannot use this library to connect to docker via unix:///var/run/docker.sock?
Depends on code place, for env resolution may be optional, for explicit programmatic configuration (in java code i set proxy for unix url) imho should throw. But afair nobody implemented ability to set Proxy directly for client. So my comment mostly about APIs that i would like to see finally.
OK sorry I wasn't clear.
I agree if proxies are programaticly set and the docker protocol is unix:// then the API should throw an exception.
I was talking about global environment which should be ignored if not appropriate. Currently 2.1.3 thows an exception if the endpoint is unix:// as it tries to resolve the proxys no matter what hte endpoint protocol is It should skip the proxy code in all cases if then the protocol of the docker endpoint is unix://
orzeh
mentioned this pull request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters