Checking NORDVPN through Make a Web Request


If you can hack together a script to use, you can return the current public IP using different techniques and pass it on to webcore. Scroll to the lower part to see the examples.

If your script detects a new IP, you can call the piston link with the newIP parameter like http://piston_address?



@eibyer I had looked at ipify and if ipify was running on my LAN, I would be able to get my public address. Unfortunately, when I use Webcore to call Ipify, since Webcore code runs in the cloud, I get the public ip of the Webcore server.

Ideally it would be awesome if someone had written a web page that I could host on a web instance on my LAN that I could do an HTTP GET to from Webcore. I’ve searched everywhere and I have no idea how to code the HTML/JSON code needed to accomplish this.

I am now searching for a Docker image that might create a Web instance for this.


I have a solution for you… Just tested and works fine to return external IP of a device on my lan (linux box).

On linux server:
python script:

#!/usr/bin/env python3
from requests import get
ip = get(‘’).text

Then I’m running Flask to create an http endpoing to execute and return the results of
Flask config:
export; flask run --host=<local_ip_of_linux_box>

from flask import Flask
import subprocess
app = Flask(__name__)

def my_ip():
    cmd = ["/root/FLASK/"]
    p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
    out,err = p.communicate()
    return out

if __name__ == "__main__" :

Now make a call from WC and it’ll store a var:


Note: You could also do this without Flask and code everything in and serve is under the apache root, just takes an extra few lines of python code and you’ll need to turn on ExecCGI in apache.conf:

<Directory /var/www/html>
	Options +ExecCGI
	AddHandler cgi-script .py

Edit: code formatting



apache.conf, enable execCGI stuff on DocumentRoot (or wherever you want to store scripts under the docroot):

<Directory /var/www/html>
	Options +ExecCGI
	AddHandler cgi-script .py

Now create the in the directory you have specified above:

# -*- coding: UTF-8 -*-# enable debugging
import cgitb
print("Content-Type: text/html;charset=utf-8")

from requests import get

ip = get('').text

Now make your GET request in webcore to log $response:

Edit: You’ll probably need to import the python libraries for “requests” and “cgitb”


One more to play with, python also that you run from cron every so many minutes. Call a webcore piston which will give you $args.IP that you can process within WC.

from requests import get

ip = get('').text
data = {'IP':ip}
get(', params=data)


@allrak The idea of running a Python script from a server on my LAN is very doable. I have a Raspi I can use or an Ubuntu Docker container that is running. I totally understand the Webcore piston. I’ve never done anything with Python scripting. So, I am an extreme NOOB there. I am not even sure if Python is installed on my Raspi.

You seem to be creating the script and then you are creating a script. I am not sure if I understand that. Is Flask another web server? Do I have to install it? I need a step by step to comprehend. LOL…see one, do one, teach one.


Easiest way is to use my second post method where it strictly uses Apache (not Flask).
The advantage to just using apache to execute your script makes it way less complicated.

Would be pretty simple to it setup on a RP3.

apt-get update
apt-get install apache2
a2enmod cgi

Add the following to /etc/apache2/apache2.conf

<Directory /var/www/html>
	Options +ExecCGI
	AddHandler cgi-script .py

Restart apache:
service apache2 restart

Install pip to handle python package installs:
apt-get install python3-pip

Satisfy library dependencies your about to use in the new script:
pip3 install requests

Create /var/www/html/

from requests import get
print("Content-Type: text/html;charset=utf-8")
ip = get('').text

Make the script executable:
chmod 755 /var/www/html/

Point your web browser to http://<your_rp3_ip>/

It should return a single item on the page… your external IP address.

Let me know if it works for ya!

Edit: *Added part about making the script executable (chmod 755)


@allrak I tried this on my Docker image but I kept getting a DNS error trying to start Apache. So, I went to a Raspi that I have and followed your excellent guide. Everything seemed to work just fine. When I go to the on my Pi, I get a “You have chosen to open a text file”. When I do, it is a Zero byte file. I checked and verified that I performed all of your steps. Advice?


The fourth time is the charm. I fixed a typo and now the opens just fine, but the resulting screen is blank. I don’t see an ip address or any text.


@allrak Yay!!! It is working. IN your example, you needed to have specified:

ip = get(‘’).text

and not HTTPS.

So, I have it returning the address in the browser. However, the HTTP GET call from the Webcore piston is coming back null. Any ideas?



Right after the GET request, I would log to console or set string variable to $response to see exactly what webCoRE sees.



The response is null, but now when I go to the web page from browser it is also null. The web call from the browser actually only worked the first time I did it after creating the python script. Now it comes back null.


@allrak I have thoroughly checked the code via your very helpful guide and although I got the web page to list the address once, now when I call, the page pauses for about five seconds and then never prints and no error either. Any further ideas?


Can you execute the python script from the command line on your rp3 and paste the output?
cd /var/www/html; ./


@allrak Here is what I am getting…



I guess I just answered my own question… I have “.txt” and not “.text”… forced habit in coding… duh, works now. Thx so much.


So everything is working now? Piston is returning the the IP address in $response?


Thank you. Finally success. Here’s the web page…

and here is the piston…


Sorry for the delayed post, but for those who find this thread later, I created a piston to make a query to my router to determine my External IP. (No Windows or Raspberry Pi required)

I have not tested this with VPN yet, but if that IP is visible from the router’s config page, it should work for that as well. It is important to note that each router can be different, so it will take a bit of customization to work in your environment.


@PhantomSpice @AvronW Did you get this going? Here’s probably the simplest way to check your ip address… A DTH from 2014 works well…