doh_client 0.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • new58

doh_client #

A library for connecting to DNS-over-HTTPS (DoH).

Usage #

A simple usage example:

import 'package:doh_client/doh_client.dart';

main() async {
  var dohResponse = await DoH(DoHProvider.google)
      .lookup('google.com', RecordType.A, dnssec: true);
  if (dohResponse != null) {
    dohResponse.answer.forEach((answer) {
      print(answer.data);
    });
  }
}

Licensing #

This project is available under the MIT license, as can be found in the LICENSE file.

Changelog #

0.1.2 #

  • Change description

0.1.1 #

  • Add comments

0.1.0 #

  • Initial version

example/main.dart

import 'package:doh_client/doh_client.dart';

main() async {
  // Request to DNS-over-HTTPS service
  var dohResponse = await DoH(DoHProvider.google)
      .lookup('google.com', RecordType.A, dnssec: true);
  // Handle if response not null
  if (dohResponse != null) {
    dohResponse.answer.forEach((answer) {
      print(answer.data);
    });
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  doh_client: ^0.1.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:doh_client/doh_client.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
15
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
58
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13

Analysis suggestions

Package not compatible with runtime flutter-web on web

Because of the import of dart:io via the import chain package:doh_client/doh_client.dartpackage:doh_client/src/doh_client_base.dartdart:io

Package not compatible with runtime web

Because of the import of dart:io via the import chain package:doh_client/doh_client.dartpackage:doh_client/src/doh_client_base.dartdart:io

Health suggestions

Format lib/src/doh_client_base.dart.

Run dartfmt to format lib/src/doh_client_base.dart.

Format lib/src/doh_response.dart.

Run dartfmt to format lib/src/doh_response.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.8.1 <3.0.0