net_passport 0.1.0 copy "net_passport: ^0.1.0" to clipboard
net_passport: ^0.1.0 copied to clipboard

Fetch Cloudflare trace metadata (including client IP) with a tiny API.

Net Passport is a tiny Dart client for Cloudflare Trace. It fetches the trace document and exposes a simple API to grab the client IP or inspect every returned key/value.

Features #

  • Fetch Cloudflare trace in one call
  • Quick NetPassport.ip() helper to grab the client IP
  • Parsed response as a Map<String, String> via CloudflareTrace
  • Override the endpoint or provide your own http.Client for testing

Getting started #

Add the dependency:

dependencies:
	net_passport: ^0.1.0

Usage #

import 'package:net_passport/net_passport.dart';

Future<void> main() async {
	final ip = await NetPassport.ip();
	print('Your public IP: $ip');

	final trace = await NetPassport.fetchTrace();
	print('Cloudflare location: ${trace['loc']}');
	print('TLS: ${trace['tls']}');
}

API #

  • NetPassport.fetchTrace({http.Client? client, Uri? uri, Duration timeout})CloudflareTrace
  • NetPassport.ip()String?
  • CloudflareTrace.valuesMap<String, String>
  • CloudflareTrace.ip / trace['key'] helpers

Notes #

0
likes
160
points
108
downloads

Publisher

verified publisherjoltax.com

Weekly Downloads

Fetch Cloudflare trace metadata (including client IP) with a tiny API.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

http

More

Packages that depend on net_passport