Check If Your Users Use A VPN – poc-vpn-detection

Category: Javascript | February 14, 2020
Author:outlandnish
Views Total:275 views
Official Page:Go to website
Last Update:February 14, 2020
License:MIT

Preview:

Check If Your Users Use A VPN – poc-vpn-detection

Description:

A vanilla JavaScript VPN detector that checks if your users are accessing your site via a VPN.

This library compares the browser’s time zone with that of the IP address and notifies your visitors if using a VPN.

How to use it:

1. Download and load the test.js library in the document.

<script type="text/javascript" src="./test.js"></script>

2. Add the #body to the body tag.

<body id="body">
  ...
</body>

3. Build the HTML for the results.

<div id="results">
  <h1 id="detection-result">VPN Detector</h1>
  <div>
    <h2 class="result">Browser Timezone</h2>
    <span id="browser-timezone" class="result"></span>
    <h2 class="result">IP Timezone</h2>
    <span id="ip-timezone" class="result"></span>
    <span id="error-detail" class="error"></span>
  </div>
</div>

You Might Be Interested In:


Leave a Reply