-
Notifications
You must be signed in to change notification settings - Fork 3
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 vs IPV4 already voted log #77
Comments
Hi Kees, very interesting question! Since I only saw IPv4 Iaddresses in my own installations, I thought that Sexy Polling uses IPv4 as a default. I just had a look at the code. The IP address is extracted by the following code:
The related values seem to be extracted from the HTTP request headers and seem to be out of control of the Joomla API. I found the following source on stackoverflow, which says that it is decided by the browser, which version of IP will be used: |
Thanks for your quick response! I don't think it's browser related. Then I see that both versions (can) be shown. Is it possible to build IPV4 into the script, or at least make it optional (or, for example, give a choice whether you want to log IPV4 or IPV6)? Thanks again for the quick response, nice script! |
In my case, it looks like this, e.g. only IPv4 is used: My understanding is that it depends on the browser, server, proxy, etc., which version of IP is used. As a result, either IPv4, or IPv6, or both in parallel is used.
Yes, I can understand this issue about IPv6 changing. How I understand your request is that you want to get the IPv4 address in case IPv4/IPv6 are used in parallel. If there was an API in Joomla (e.g. something like ->server->getIP(string $IPversion) ), I could retrieve the IP in a certain version. However, Joomla and PHP seemingly only offer the variables shown above, e.g. the provided values from the HTTP request headers like $REMOTE_ADDR. I am not an expert for those HTTP request header values. If you can give me a hint how I can get IPv4 out of these values if IPv4/IPv6 is used in parallel, I will try. |
I have searched the internet for a while, but I have not yet been able to find a solution on how to specifically read an IPV4 address. I think it should be possible because in the example I sent IPV4 and IPV6 are also specified separately. Unfortunately, my PHP knowledge does not go so far that I immediately have an answer/solution for it. |
I spent some time to check this issue in more depth. In order to check the behavior I found a possibility in my network to switch between IPv4 and IPv6 and the combination of both. With debugging on the Joomla server, I tried to identify how PHP handles these situations. The result of these examination was that PHP always offers information in IPv4 only or IPv6 only and seemingly never a mixture of IPv4/IPv6 information. Another way to see this is to use a phpinfo file and check for the values of the PHP Variables "$_SERVER['HTTP ...". Therefore, it looks like it is not possible to solve this issue. |
Some additional idea: Maybe, you can identify an option to configure your server to use IPv4? |
My provider uses an IPV4 and an IPV6 address as standard. They cannot (or do not want to) change this. And if they want to change it, they have to do it for everyone to make it work properly :) I think it's nice that you think so well about a solution. So you would think that there should be a possibility to read IPV4 and IPV6. But I wouldn't dare say how :) |
I think this poll script is a very nice script. However, it is now logged on IPV6. Can this also become IPV4 (optional)? IPV6 has the disadvantage that it changes every few hours (worldwide this is the case with IPV6). IPV4 doesn't have that problem. I would like to log on IPV4 (who has already voted).
Greets Kees.
The text was updated successfully, but these errors were encountered: