Skip to content

Add DEFAULTUNIXSOCKET to no_proxy - #10133

Closed
coolljt0725 wants to merge 1 commit into
moby:masterfrom
coolljt0725:add_host_to_noproxy
Closed

coolljt0725 wants to merge 1 commit into
moby:masterfrom
coolljt0725:add_host_to_noproxy

Conversation

@coolljt0725

Copy link
Copy Markdown
Contributor

Signed-off-by: Lei Jitang [email protected]

PR #9951 enable client via proxy,and this cause a problem.
When I set the http_proxy and https_proxy,docker client can't work
and return FATA[0000] Error response from daemon: 404 page not found and add /var/run/docker.sock
to no_proxy, it work.
I don't konw if the fix is right or I understand the proxy correctly,please correct me if not.
Thanks.

@icecrime icecrime added this to the 1.5.0 milestone Jan 16, 2015
@icecrime

Copy link
Copy Markdown
Contributor

Ping @jfrazelle @crosbymichael: seems like something we need to look into before 1.5.

@jessfraz

Copy link
Copy Markdown
Contributor

shoot yeah this could be a problem

@jessfraz

Copy link
Copy Markdown
Contributor

There is no mention of https_proxy in the golang docs https://golang.org/src/net/http/transport.go
This should be handled by deafult by the change in #9951 according to the comments in the golang http code

// DefaultTransport is the default implementation of Transport and is
// used by DefaultClient. It establishes network connections as needed
// and caches them for reuse by subsequent calls. It uses HTTP proxies
// as directed by the $HTTP_PROXY and $NO_PROXY (or $http_proxy and
// $no_proxy) environment variables.

@jessfraz

Copy link
Copy Markdown
Contributor

The fix is us setting no_proxy for the user which I think is unnecessary and maybe we need to just have docs surrounding the proxy changes so users know to do that if they are using a proxy so we do not have do it. The default sock should not always be added to no_proxy.

@icecrime

Copy link
Copy Markdown
Contributor

The default sock should not always be added to no_proxy.

Can you explain why? I'm not sure I see what good reason we'd have to use a proxy for a UNIX socket :-(

@jessfraz

Copy link
Copy Markdown
Contributor

Well for one the default sock is not always used, so what about the case where it is not. Seems unnecessary to add it to a no_proxy var. I don't see harm necessarily but it feels a bit off.

@icecrime

Copy link
Copy Markdown
Contributor

So what do you suggest? Docker wide --no-proxy flag?

$ docker --no-proxy=/var/run/docker/sock,127.0.0.1 version

@jessfraz

Copy link
Copy Markdown
Contributor

I would suggest docs covering how to set up a proxy so we don't inadvertently force setting the env variable when it might break for other people. So basically just use docs to explain and us not set no_proxy at all. But I would like @andersjanmyr's opinion as well, seeing as he is the author of the original patch.

@jessfraz

Copy link
Copy Markdown
Contributor

we don't need a flag either, people just need to know how to set the no_proxy env variable and how/when it is needed for their use case.

@icecrime

Copy link
Copy Markdown
Contributor

I'm closing this for now: please @coolljt0725 or @andersjanmyr feel free to chime in if you really feel a patch is the right approach here. Right now I think @jfrazelle is right and documentation is the way to go (hence I created #10192).

@icecrime icecrime closed this Jan 19, 2015
@andersjanmyr

Copy link
Copy Markdown
Contributor

+1 The documentation solution is fine with me, everything works the way I expect it to.

@rgeary1

rgeary1 commented Apr 2, 2015

Copy link
Copy Markdown

This issue stung me today, it took several hours to work out that it was the client side (not the docker service) that was set up incorrectly. Google searches for this issue took me in several wrong directions.

The new documentation is too obscure - please would you consider giving the user a better error message (when http_proxy is set & no_proxy is not correct) that points to the no_proxy documentation?

@cpuguy83

cpuguy83 commented Apr 2, 2015

Copy link
Copy Markdown
Member

@rgeary1 This is fixed for unix socks in 1.6

@piotr-dobrogost

Copy link
Copy Markdown

@rgeary1
The fix mentioned by @cpuguy83 is pull #10739.

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.

7 participants