This is simple NTP server with offers offset feature. This may helped test system based on time.

Features

Offset of time may be changed or UDP default server port.

Getting started

Add library to your project by pub.dev.

Usage

Using the server with default settings (UDP port 123 and 0 sec. offset):

void main() {
  NTPServer srv = NTPServer();
  srv.start();
}

Using the server with nondefault 1234 UDP port and 1h offset (3600 in seconds):

void main() {
  NTPServer srv = NTPServer(offset: Duration(seconds: 3600));
  srv.start(1234);
}

Additional information

More ifno you can find in RFC5905 https://datatracker.ietf.org/doc/html/rfc5905

License

License under MIT

Libraries

dart_ntp