stun_dart 0.1.0+1-dev stun_dart: ^0.1.0+1-dev copied to clipboard
Simple plug and play stun client for dart. This will let you know your current public IP, port and NAT type details.
import "package:stun_dart/stun.dart";
void main() async {
int _responseCounter = 0;
initializeStun(callback: (String selfAddress) {
var response = calculateResponse();
print(selfAddress);
print(response.result);
print(response.natType);
_responseCounter++;
});
while (_responseCounter < 7) {
await Future.delayed(Duration(seconds: 2));
}
await stopStunning();
}