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 #10

Open
samuong opened this issue Jul 4, 2019 · 2 comments · Fixed by #105
Open

IPv6 Support #10

samuong opened this issue Jul 4, 2019 · 2 comments · Fixed by #105
Assignees
Labels
enhancement New feature or request

Comments

@samuong
Copy link
Owner

samuong commented Jul 4, 2019

The PAC "standard" as defined by Netscape includes a few functions that assume IPv4, so Alpaca currently only supports IPv4.

Microsoft has a few extensions which work better for IPv6 and Google has implemented some of these functions into Chrome (although they make these functions available in the regular FindProxyForURL function, rather than just scoping it to FindProxyForURLEx). These include dnsResolveEx() and myIpAddressEx(), and they both replace functions that return IPv4 addresses only with functions that could return either (or both).

There are also other functions that accept IPv4 addresses, and should be extended to accept IPv6 addresses as well. These include isResolvable() and isInNet().

The only remaining function is convert_addr(). There doesn't appear to be an IPv6 version in Mozilla, Microsoft or Google's implementations, and it doesn't make sense for Alpaca to implement its own extension to the standard, so I'll leave this as it is.

@samuong samuong added the enhancement New feature or request label Jul 4, 2019
@samuong samuong self-assigned this Jul 4, 2019
@samuong samuong linked a pull request Sep 17, 2022 that will close this issue
@samuong
Copy link
Owner Author

samuong commented May 28, 2024

For some reason I closed this when #105 was merged, which was a mistake. That PR was about listening on a local IPv6 port, whereas this issue is about supporting IPv6-aware functions for PAC scripts to call.

As of #123, it is now possible for myIpAddress() to return an IPv6 address. If Alpaca isn't consistent about this, it might break PAC scripts that expect an IPv4 address (e.g. myIpAddress() returns an IPv6 address but the script passes the result to isInNet() rather than isInNetEx()). This should be considered before the next release.

Some references:

  1. Microsoft's IPv6 Extensions to Navigator Auto-Config File Format: https://learn.microsoft.com/en-us/windows/win32/winhttp/ipv6-extensions-to-navigator-auto-config-file-format
  2. A table from the Chromium source code showing IPv6 support in Firefox 3, Internet Explorer 8 and Chrome: https://source.chromium.org/chromium/chromium/src/+/main:services/proxy_resolver/proxy_resolver_v8.cc;l=75-86;drc=8788592a9d2efcececd4f8cfacc174671b265ad2

@samuong samuong reopened this May 28, 2024
@samuong
Copy link
Owner Author

samuong commented May 29, 2024

As I mentioned in my previous comment, I'm inclined to keep all the functions IPv4-only, and build support for IPv6 only in the *Ex() functions, which would be IPv4/IPv6.

I've reproduced the table from the Chromium source code below, and added a row for isInNet() and a column for what I think Alpaca should do:

Firefox 3 Internet Explorer 8 Chrome Alpaca
myIpAddress() IPv4/IPv6 IPv4 IPv4/IPv6 IPv4
dnsResolve() IPv4/IPv6 IPv4 IPv4 IPv4
isResolvable() IPv4/IPv6 IPv4 IPv4 IPv4
isInNet() ? ? IPv4 IPv4
myIpAddressEx() N/A IPv4/IPv6 IPv4/IPv6 IPv4/IPv6
dnsResolveEx() N/A IPv4/IPv6 IPv4/IPv6 IPv4/IPv6
sortIpAddressList() N/A IPv4/IPv6 IPv4/IPv6 IPv4/IPv6
isResolvableEx() N/A IPv4/IPv6 IPv4/IPv6 IPv4/IPv6
isInNetEx() N/A IPv4/IPv6 IPv4/IPv6 IPv4/IPv6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant