matomo-org / device-detector

The Universal Device Detection library will parse any User Agent and detect the browser, operating system, device used (desktop, tablet, mobile, tv, cars, console, etc.), brand and model.
http://devicedetector.net
GNU Lesser General Public License v3.0
3.15k stars 482 forks source link

suggestion: VPN detection #7501

Closed 8ctopus closed 1 year ago

8ctopus commented 1 year ago

Thank you for a great package, I have just switched over from sinergi/browser-detector which is abandoned. Would you consider detecting that the user is using a VPN? I think the feature could be useful.

sanchezzzhak commented 1 year ago

Hi, we have the definition of some VPN clients as an application.

Example https://github.com/matomo-org/device-detector/blob/bb5846c6876934816416c6a097e065022fa1d79a/Tests/fixtures/clienthints-app.yml#L237-L253

Sometimes it can be a separate browser with VPN function

https://github.com/matomo-org/device-detector/blob/bb5846c6876934816416c6a097e065022fa1d79a/Tests/Parser/Client/fixtures/browser.yml#L6156-L6165

8ctopus commented 1 year ago

Thank you for your quick reply. Yes I saw that, I think that there are probably other factors that can be looked at to detect the use of a VPN

sgiehl commented 1 year ago

@8ctopus I guess the most reliable way to detect that would be to use a geolocation database and detect that based on the IP. You could e.g. use https://www.maxmind.com/en/solutions/geoip2-enterprise-product-suite/anonymous-ip-database or similar. Doing that based on the useragent would give very inaccurate data...

8ctopus commented 1 year ago

Thank you Stefan for your answer, I will close the issue.