just a simple ntp proxy
sample config in config.sample.json
Demo is available at ntpproxy.sculk.ltd.
Also this proxy is used on ntp.sculk.ltd website where you
can check difference your computer's time and server time.
Servers available on demo can be retrieved using this endpoint:
https://ntpproxy.sculk.ltd/servers
Get list of servers, read from config.json
Sample answer:
{
"servers": [
{
"address": "ru-01.ntp.sculk.ltd",
"text": "Russia, Moscow - Stratum 2",
"stratum": 2
},
{
"address": "ntp1.vniiftri.ru",
"text": "Russia, Moscow - Stratum 1",
"stratum": 1
}
]
}Replace :server with address field from config.json
or /servers endpoint. For example: /current/ru-01.ntp.sculk.ltd.
Sample success answer:
{
"adjusted_time": 1733534988647,
"ntp_time": 1733534988647,
"jitter": 134,
"address": "212.113.99.6",
"offset": 100,
"unix_time_millis": 1733534988647,
"host_name": "ru-01.ntp.sculk.ltd",
"stratum": 2
}Where:
adjusted_timeandunix_time_millis(they are the same) - current time in Unix milliseconds format that includes offsetntp_time- current time in Unix milliseconds format received from the NTP serverjitter- time in milliseconds between the time when proxy received request and when NTP answeredaddress- IPv4 / IPv6 address resolved from hostnameoffset- time in milliseconds between the time when proxy received request and when NTP received requesthost_name- requested hostname of NTP serverstratum- stratum received from NTP server
Sample error answer:
{
"error": "No server with identifier nonexistent.ntp.sculk.ltd found"
}There are always only one field error with description.
Currently error messages are returned with 200 http code. That's a known bug.
© 2024 edwardcode
Hosted by Sculk Ltd.