Skip to content
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

IPV6 support for proxy #2071

Closed
max-au opened this issue May 9, 2019 · 4 comments
Closed

IPV6 support for proxy #2071

max-au opened this issue May 9, 2019 · 4 comments
Labels
enhancement new behaviour or additional functionality

Comments

@max-au
Copy link
Contributor

max-au commented May 9, 2019

Feature request

Current behaviour

It's possible to set either environment variable HTTPS_PROXY, or HTTP_PROXY, or use global rebar configuration file to specify proxy name and port.

However there is no way to specify Internet Protocol Family (ipv6), so machines that need to connect to proxy using IPv6 cannot use rebar3.

Expected behaviour

Line 905 of src/rebar_utils.erl (also in bootstrap):

httpc:set_options([{Scheme, {{Host, Port}, []}}], rebar),

To use ipv6, it's necessary to set this for rebar httpc profile:

httpc:set_options([{ipfamily, inet6}], rebar).

@ferd ferd added the enhancement new behaviour or additional functionality label May 9, 2019
@tsloughter
Copy link
Collaborator

Should it use a separate env var so the rebar.config doesn't have to be updated? Like HTTPS_PROXY_IPV6? And it'd use that if set.

@ferd
Copy link
Collaborator

ferd commented May 9, 2019

The variable is kind of a standard mechanism in more than one application, so I believe we should be able to support IPv6 within existing variables. For example, the following projects all added support for it:

@max-au
Copy link
Contributor Author

max-au commented May 9, 2019

That would work for IP addresses, but not actual name (and BTW I think it is already working).
(saw comment in bundler - "Fair enough. We're unlikely to support IPv6 proxies soon, then.")
I agree we should not use any more environment variables.

Root cause is inability of "escript" runner to use .inetrc file (or have {inet6, true} to be specified when starting rebar3 escript). It may be worth to explore that path, and include a fix into OTP.

Confirming - even when node has no IPv4 address (except for loopback interface with 127.0.0.1 on it), DNS client still tries to use IPv4 only, failing to resolve remote host name. I guess the issue can be closed, as it's OTP problem, not rebar.

max-au added a commit to max-au/rebar3 that referenced this issue Feb 13, 2020
Solves erlang#2071, IPV6 support for proxy, by trying to resolve proxy
host name without specific IP address family. If it fails, it
attempts a different IP family, and in case that succeeds, it
sets up HTTP client profile to use IP family that worked.
@max-au
Copy link
Contributor Author

max-au commented Oct 17, 2020

Can be closed, now it works.

@max-au max-au closed this as completed Oct 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new behaviour or additional functionality
Projects
None yet
Development

No branches or pull requests

3 participants