dio_http_adapter 0.1.0+2 copy "dio_http_adapter: ^0.1.0+2" to clipboard
dio_http_adapter: ^0.1.0+2 copied to clipboard

A customized dio HttpClientAdapter, to workaround the Host verification issue during SSL handshake.

dio_http_adapter #

Pub Check Status BSD

A customized dio HttpClientAdapter based on the dart:io package, to work around the "Hostname mismatch" issue when accessing URIs with an IP address (DNS over HTTP for example).

Usage #

Get an IP address of the 'pub.dev' site:

ping pub.dev
PING pub.dev (216.239.38.21) 56(84) bytes of data.
64 bytes from any-in-2615.1e100.net (216.239.38.21): icmp_seq=1 ttl=112 time=88.7 ms

Or using a dart package like dns

Access it using dio:

final dio = Dio(BaseOptions(
  baseUrl: 'https://216.239.38.21', // uses an IP address
  headers: <String, dynamic>{
    'host': 'pub.dev', // specifies the host name
  },
))..httpClientAdapter = IoHttpClientAdapter(); // uses the customized adapter

final resp = await dio.head('/');
1
likes
40
pub points
36%
popularity

Publisher

verified publisherxinthink.com

A customized dio HttpClientAdapter, to workaround the Host verification issue during SSL handshake.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

dio, io_http, meta

More

Packages that depend on dio_http_adapter