Cloudflare DDNS Worker API
MIT License
Author: Nikhil John (@nikhiljohn10 / @nikzjon)
HTTPS Request
Method: POST
URL: https://ddnslab.nikz.in
ContentType: application/json
Body: {
apiToken: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
recordName: "The A Record name created for DDNS client",
proxied: true/false
}
Example using CURL for Linux Terminal:
curl -X POST "https://ddnslab.nikz.in/" -H "Content-Type: application/json" --data '{"apiToken":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","recordName":"home.example.com","proxied": true}'
Example using Node.JS for Linux Users:
const https = require('https')
const data = JSON.stringify({
"apiToken":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"recordName":"home.example.com",
"proxied": true
})
const options = {
hostname: 'https://ddnslab.nikz.in/',
port: 443,
path: '/',
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
}
const req = https.request(options, (res) => {
res.on('data', (d) => {
process.stdout.write(d)
})
})
req.on('error', (error) => {
console.error(error)
})
req.write(data)
req.end()
Example using Batch File for Windows Users:
@echo off
title CloudFlare DDNS Service
echo Initiating service...
:loop
curl https://ddnslab.nikz.in/ -H Content-Type:application/json --data "{\"apiToken\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"recordName\":\"home.example.com\",\"proxied\":true}"
echo ^: %date% %time%
timeout /t 60 /nobreak > NUL
goto loop
pause
Notes: