dartmole_plugin 0.2.0
dartmole_plugin: ^0.2.0 copied to clipboard
Routes a Flutter app's HTTP through Dartmole, so it can be inspected and mocked.
0.2.0 #
Easier to integrate. Everything in 0.1.0 keeps compiling and working.
createHttpClient()returns a client that follows Dartmole for as long as the app keeps it: each new request uses the pairing and intercept switch of that moment, and requests underway finish as they started. One adapter per Dio is now the whole integration, however many Dio instances an app creates, and whenever. The client checks Dartmole on each request rather than listening, so dropped clients leave nothing behind. What the app sets on it (timeouts, credentials,badCertificateCallback, ...) carries over; its ownfindProxyapplies only while Dartmole is off. Migration: remove theDartmole().addListener(...)that reassigns your adapter. It still works but is no longer needed.Dartmole().rememberPairing()reconnects to the last machine at launch and stores every change, in a file in the app's private storage that is left out of backups.PairingStorageto store it elsewhere. Waits at mostwait(two seconds) and never throws. The example'spairing_store.dartis gone.Dartmole.onLog: where the plugin reports problems,debugPrintby default.debugSetPairinganddebugReset, so apps can test their own code against paired, switched-off and unpaired states without a network.Dartmole().revision, bumped once per change.enable(),disable()andunpair()no longer notify listeners when they change nothing.- On iOS, the panel keeps trying to pair for up to 30 seconds while nothing
answers, so pairing finishes once the tester allows local network access,
instead of failing behind the prompt.
PairingException.unreachabletells that case apart, and its message on iOS points to the Local Network setting. - Fixed: scanning a QR code could close the app's own screen as well as the scanner, leaving it blank, because the camera kept reporting the code while the scanner animated away. The scanner also releases its camera now.
- The README covers Android's cleartext policy, which does not affect
pairing, and says that
NSLocalNetworkUsageDescriptionis recommended rather than required: iOS asks for local network access either way.
0.1.0 #
First release.
Dartmole().createHttpClient()routes Dart HTTP through a paired Dartmole, trusting its certificate authority alongside the system ones. Unpaired or switched off, it is an ordinaryHttpClient.- Pairing by QR code or typed address, in the
DartmoleSettingspanel. Pairing.toJson/fromJsonandDartmole().reconnectfor remembering a pairing across launches, with the certificate authority pinned.- Also intercept native traffic links to Dartmole's setup page for
device-wide interception.
UserCertificateTrust.check()tells whether the build can use it; on Android this reads the build's network security config. DartmoleSettingschecks that interception works rather than only that it is on: a request down Dart's networking and one down the platform's, with what is missing when either does not reach Dartmole. In code:checkDartTraffic()andcheckNativeTraffic(). The plugin now has iOS native code as well as Android.