Check if a user is using a VPN - Guide

Detect if the user uses a VPN


Today I’m gonna show you how you can check an user’s IP and see if they are using a VPN without any extension and without a limit.

Step 1

Drag 2 web component into your screen.
image image x2
leave the settings for the first web component.
For the second, put this as url : https://api.ipify.org/
image

Step 2

:warning: This part of the guide is outdated, please see Check if a user is using a VPN - Guide - #5 by ShadowDEV_fr

Go into the blocks screen, and drop the following blocks:

blocks(6) blocks(7) blocks(8)

Step 3

It works! Leave a like if this helped you :slight_smile:

10 Likes

thank you for your contribution!

further reading concerning the services used see here:
http://getipintel.net/
https://www.ipify.org/

Taifun

2 Likes

Yeah, I’ve forgotten to put it on my topic

(btw I love what you do and I day thank you for your extension directory, i’ts very useful, maybe try and put a more “modern” design?)

2 Likes

This does not work for me. Returns -5 no matter if I am using a VPN or no


1 Like

Strange :thinking: seems like they changed their API or smth…
I found another API: https://proxycheck.io/
You can parse the result with the JSON component, and get the “type”

Here with nordvpn:
image
I am connected to the belgium server, and you can see that in the “type” return “VPN”
image (I’m using ubuntu so yeah)

Without a VPN it will output "type": "Residential"

So from this you can check if the value of “type” is a VPN.

1 Like

Cool, it works, sometimes. Here’s when I am connected to another server


Their server is probably hosted with Azure

Maybe :thinking:
Well you just have to test if “type” is “Residential” maybe it’ll work better

Please make a Extension

(https://api.ontstudios.com/proxy/check.php)
any alternative for this ? This was very easy to implement in the app, now its not working, any kodular staff please help

Ssarch the extensions directory for an extension

Taifun

You may give this a try:
com.django.djvpnchecker.aix (5,4 KB)

Edit: This is no official extension, just a helper extension for you to test if this solves your issue.

2 Likes

Is this the first time you are publishing this extension?
Up to now it is not in the extensions directory…
Could you please start a new thread in category #extensions to publish the extension including a short documenation?

Taifun

Thankyou and please do documentation for this as suggested by Mr.Taifun @Taifun @Django_s_Android_App

This extension has only one method that throws out a boolean, True or false.
But the question is:
Does it solve your problem or not?
BTW, in times of restriction to 5 extensions for a non Premium user an extension shouldn’t have only 1 method :wink: So I wouldn’t release it.

1 Like

don’t worry about that…
there are also other builders… and MIT App Inventor does not have any restrictions…

Taifun

Screenshot 2024-06-09 014015

Can i use it in this way ? or can you please show your blocks arrangement… @Django_s_Android_App

No, you have to use boolean true or false blocks or just remove them completely like this

if DjVpnChecker.IsVpnActive
then close application
else open another screen ...

Taifun

1 Like

blocks (1)
And don’t forget to tell if it works for you.

1 Like

Thank you for your fast response, this one does the job :grin: @Django_s_Android_App @Taifun