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

Add support for local proxies #10

Open
pameck opened this Issue Jun 28, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@pameck
Copy link
Contributor

pameck commented Jun 28, 2018

Hi,
I am using cntlm to go through a proxy.
The environment variables that I have set in my host are something like this:

https_proxy=http://localhost:3333
http_proxy=http://localhost:3333
...

I have to set the variables in batect.yml to something like this:

....
   environment:
      - https_proxy=http://host.docker.internal:3333
      - http_proxy=http://host.docker.internal:3333
..

Otherwise batect.yml picks up the ones set in the environment which wouldn't work within the container.

@charleskorn

This comment has been minimized.

Copy link
Owner

charleskorn commented Jun 28, 2018

Thanks for the feedback @pameck, this seems like something that batect should take care of for you.

On Mac it looks pretty straightforward: if the proxy refers to localhost or 127.0.0.1, use host.docker.internal on Docker 18.03+ or the now-deprecated docker.for.mac.localhost on Docker 17.06+.

On Linux, it's not quite that simple. docker/for-linux#264 talks about adding support for host.docker.internal to Linux hosts, but that hasn't been implemented. I'm sure there's a way to do it though, I'll do some digging.

charleskorn added a commit that referenced this issue Jul 3, 2018

@charleskorn charleskorn changed the title Add support for authentication proxy Add support for local proxies Jul 5, 2018

@charleskorn charleskorn self-assigned this Jul 5, 2018

charleskorn added a commit that referenced this issue Jul 5, 2018

Add function to get hostname of Docker host.
This currently only supports more recent versions of Docker for Mac.

This will be required to implement #10.

charleskorn added a commit that referenced this issue Jul 6, 2018

Rewrite proxy URLs that target the host machine on OS X.
This means that #10 is now implemented on OS X. (It is not yet
implemented for Linux hosts, as that will be far more involved.)
@charleskorn

This comment has been minimized.

Copy link
Owner

charleskorn commented Jul 6, 2018

Support for this on OS X has been added and will be included in 0.16.

Supporting this on Linux is way more involved, so I'm not going to add it right now.

Thanks again for the feedback @pameck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment